Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A lambda resetting its timeout by calling lambda_runtime.report_done
import time
import runtime as lambda_runtime
def reset_timeout(event, context):
"""
A lambda resetting its timeout by calling lambda_runtime.report_done
"""
print "Remaining time: ", context.get_remaining_time_in_millis()
time.sleep(10)
print "Remaining time: ", context.get_remaining_time_in_millis()
lambda_runtime.report_done(context.aws_request_id, None, 'Success', 0)
time.sleep(0.1)
print "Remaining time: ", context.get_remaining_time_in_millis()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.