Last active
August 3, 2017 11:25
-
-
Save guillaumekh/4484a1f94ecbc88bc9d6fe5d881d7127 to your computer and use it in GitHub Desktop.
abort node lambda on retry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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