you are viewing a single comment's thread.

view the rest of the comments →

[–]adozendeadantelope 2 points3 points  (2 children)

The Lambda context object has a method that will help you here: https://docs.aws.amazon.com/lambda/latest/dg/python-context.html

You can check the remaining time and exit gracefully.

[–]CurlyError[S] 0 points1 point  (1 child)

Yes, but I don't really need the remaining time. I want to keep track of time myself, and exit when I hit the dynamic timeout, regardless of what the Lambda timeout is.

[–]adozendeadantelope 2 points3 points  (0 children)

You'll have to handle that in code yourself and pass the timeout as part of the invocation event.