I know that when a Lambda function fails (for example when there is a time out), it tries to run the function 3 more times again. Is there any way to avoid this behavior? I\
I achieved this by placing the following line of code:
callback(null, "message");
Into my function such as the below update to DynamoDB. When there is an error, rather than retrying for hours on end, this callback outside of the if / else will stop the retries.
dynamodb.updateItem(params, function(err, data){
if (err) {
console.log(err)
callback(err, data)
} else {
console.log(data);
callback(null, data);
}
callback(null, "message");
});