Skip to content

Instantly share code, notes, and snippets.

@keithrozario
Last active April 17, 2019 15:15
Show Gist options
  • Save keithrozario/ea4c63ed056bab69399a34c1996eed67 to your computer and use it in GitHub Desktop.
Save keithrozario/ea4c63ed056bab69399a34c1996eed67 to your computer and use it in GitHub Desktop.
Reinvoke Lambdas
message['ContinuationToken'] = token
if context.get_remaining_time_in_millis() < reinvoke_seconds * 1000:
logger.info(f"Running out of time, invoking new lambda")
response = sqs_client.send_message(QueueUrl=os.environ['sqs_list_bucket_url'],
MessageBody=json.dumps(message),
DelaySeconds=2)
logger.info(f"Called new message with messageId: {response['MessageId']}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment