lambda-warmer
lambda-warmer copied to clipboard
Warmer event randomly not detected in lambda
One of our lambdas randomly doesn't detect the event as a warmer event and proceed further which breaks our code (it happens 2-5 times a day).
Our code looks like below:
module.exports.execute = async (event, context, callback) => {
// Warming up the lambda.
if (await warmer(event)) {
console.log('Warming up the lambda');
return;
}
// Other code
}
We use serverless to schedule the warmer.
- schedule:
name: ${self:service}-${self:provider.region}-${self:provider.stage}-warmer-lambda
rate: rate(5 minutes)
enabled: ${self:custom.warmup.enabled.${self:custom.config.environment}}
input:
warmer: true
concurrency: 3
Using atleast v3.5.0 of thelambda-warmer.
node version 8.10.0
The same started happening to me. Also, even if I scheduled the warmer to run every 5 minutes, it started triggering the Lambda every minute.
Given that I didn't need the concurrency feature, I just uninstalled this library and modified the condition to check event.warm.