From 8fc5b777db5e1fa879d5b61b88ff80d4bc7110ed Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Sat, 14 Mar 2020 10:42:50 +0100 Subject: [PATCH] api: Fix undefined variable reference from previous commit. --- zulip/zulip/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)