We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 056963b commit 9c3a3c2Copy full SHA for 9c3a3c2
zulip/zulip/__init__.py
@@ -94,9 +94,8 @@ def fail(self):
94
super(RandomExponentialBackoff, self).fail()
95
# Exponential growth with ratio sqrt(2); compute random delay
96
# between x and 2x where x is growing exponentially
97
- delay_scale = int(2 ** (self.number_of_retries / 2.0 - 1)) + 1
98
- delay = min(delay_scale + random.randint(1, delay_scale), delay_cap)
99
- message = "Sleeping for %ss [max %s] before retrying." % (delay, delay_scale * 2)
+ delay = random.random() * min(self.delay_cap, 2 ** self.number_of_retries)
+ message = "Sleeping for %ss before retrying." % (delay,)
100
try:
101
logger.warning(message)
102
except NameError:
0 commit comments