Skip to content

Commit

Permalink
Merge pull request #8 from transifex/raise-exception-after-max-backoff
Browse files Browse the repository at this point in the history
Raise OperationError after backoff exceeds
  • Loading branch information
fathineos authored Feb 12, 2024
2 parents cbe9f6f + 7571e2a commit c0644a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hermes/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def execute_role_based_procedure(self):
self.log.warning('Server is a slave, stopping components')
self._stop_components()
break
except OperationalError:
except OperationalError as e:
self._stop_components()

self.log.warning(
Expand All @@ -277,7 +277,7 @@ def execute_role_based_procedure(self):
if backoff: # pragma: no cover
backoff <<= 1
if backoff > 32:
backoff = 1
raise e
else:
backoff = 1
sleep(backoff)
Expand Down

0 comments on commit c0644a7

Please sign in to comment.