Skip to content

Instantly share code, notes, and snippets.

@guillaumekh
Last active August 3, 2017 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guillaumekh/4484a1f94ecbc88bc9d6fe5d881d7127 to your computer and use it in GitHub Desktop.
Save guillaumekh/4484a1f94ecbc88bc9d6fe5d881d7127 to your computer and use it in GitHub Desktop.
abort node lambda on retry
var lastReqId;
exports.handler = function ( event, context ) {
if ( lastReqId == context.awsRequestId ) {
return context.succeed(); // abort
} else {
lastReqId = context.awsRequestId; // keep request id for next invokation
};
/** your lambda code **/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment