Hi
We have multiple lambdas and we are using terraform to deploy it so the input as an event that I am providing is
{"warmer": true, "functions": ["lambda_b", "lambda_c",...]}
When I am using a lambda (say Lambda_A) function so as to warm other lambdas at a rate of 15 minutes from the scheduler, I can see that the lambda is being invoked every 10 seconds.
I believe the library is already invoking itself (using aws-sdk) and also the other lambdas.
Lambda_A code:
`
if (await warmer(event)) {
logger.info('Warmed lambda warmer itself!');
if (!event.functions) return 'No functions to warm up!';
let lambda = new AWS.Lambda();
let warmers = event.functions.map(functionName => {
let params = {
FunctionName: functionName ,
InvocationType: 'Event',
LogType: 'Tail',
Payload: Buffer.from(JSON.stringify(event))
}
return lambda.invoke(params).promise();
});
try { await Promise.all(warmers)} catch (e) {
logger.info('Error while warming some lambdas');
logger.error(e);
}
logger.info('Warmed all lambdas');
return 'Warming done!';
}
return 'Nothing more to do here!';`
Lambda_B code:if (await warmer(event, { log: false })) { logger.info('Warmed!!'); return 'Warmed'; } // Rest of the implementation
Turns out this issue was due to a million requests that were performed earlier and were being served even after new functions were deployed.
Thanks a ton J.
Hi We have multiple lambdas and we are using terraform to deploy it so the input as an event that I am providing is
{"warmer": true, "functions": ["lambda_b", "lambda_c",...]}
When I am using a lambda (say Lambda_A) function so as to warm other lambdas at a rate of 15 minutes from the scheduler, I can see that the lambda is being invoked every 10 seconds. I believe the library is already invoking itself (using aws-sdk) and also the other lambdas.Lambda_A code: ` if (await warmer(event)) {
Lambda_B code:
if (await warmer(event, { log: false })) { logger.info('Warmed!!'); return 'Warmed'; } // Rest of the implementation
aws-sdk: 2.414.0