Skip to content

Commit

Permalink
Reconnect if ioloop fails to get started
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Jan 2, 2025
1 parent f845c3f commit ea50901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neon_mq_connector/consumers/select_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def run(self):
self.connection: pika.SelectConnection = self.create_connection()
self.connection.ioloop.start()
except Exception as e:
LOG.error(f"Failed to start io loop on consumer thread {self.name!r}: {e}")
self._close_connection()
LOG.error(f"Failed to start io loop on consumer thread {self.name!r}: {e}, reconnecting")
self.reconnect()

def _close_connection(self, mark_consumer_as_dead: bool = True):
try:
Expand Down

0 comments on commit ea50901

Please sign in to comment.