Skip to content

Commit

Permalink
Merge pull request #56 from mikebonnet/limit-failover-delay
Browse files Browse the repository at this point in the history
STOMP: wait at most 60 seconds between reconnect attempts
  • Loading branch information
ralphbean committed Apr 30, 2018
2 parents 0f3d9db + fe2d037 commit 8809a98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moksha.hub/moksha/hub/stomp/stomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def clientConnectionFailed(self, connector, reason):
def failover(self):
self.address_index = (self.address_index + 1) % len(self.addresses)
args = (self.addresses[self.address_index], self.key, self.crt,)
self._delay = self._delay * (1 + (2.0 / len(self.addresses)))
self._delay = min(60.0, self._delay * (1 + (2.0 / len(self.addresses))))
log.info('(failover) reconnecting in %f seconds.' % self._delay)
reactor.callLater(self._delay, self.connect, *args)

Expand Down

0 comments on commit 8809a98

Please sign in to comment.