diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index a63fc50..21c862f 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -95,7 +95,7 @@ class RandomExponentialBackoff(CountingBackoff): # Exponential growth with ratio sqrt(2); compute random delay # between x and 2x where x is growing exponentially delay_scale = int(2 ** (self.number_of_retries / 2.0 - 1)) + 1 - delay = min(delay_scale + random.randint(1, delay_scale), delay_cap) + delay = min(delay_scale + random.randint(1, delay_scale), self.delay_cap) message = "Sleeping for %ss [max %s] before retrying." % (delay, delay_scale * 2) try: logger.warning(message)