Last active
July 4, 2019 15:40
-
-
Save scdekov/a737be39e3e58160b4fa241d4b43ce1c to your computer and use it in GitHub Desktop.
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
def restart(self): | |
restart_all_messages = not self.filters | |
while True: | |
if not restart_all_messages and not self.filters: | |
return | |
messages = self._retrieve_messages() | |
if not messages: | |
return | |
if not restart_all_messages: | |
messages = self._filter_messages(messages) | |
self.filters = [id for id in self.filters if id not in [msg.id for msg in messages]] | |
send_sqs_message_batch(messages, self.queue_url) | |
delete_sqs_message_batch(messages, self.dlt_queue_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment