summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-25 14:27:19 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-25 14:27:19 +0000
commitd8e34ad17ffc5ffd797e0232d8010cb72b9f0c7e (patch)
treec5fc4416305b4e891d7886e0ccad96d1b0c3382f /synapse/util
parentMerge pull request #6024 from matrix-org/dbkr/fix_sso_fallback_login (diff)
parentFix bug in calculating the federation retry backoff period (#6025) (diff)
downloadsynapse-d8e34ad17ffc5ffd797e0232d8010cb72b9f0c7e.tar.xz
Fix bug in calculating the federation retry backoff period (#6025)
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/retryutils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/util/retryutils.py b/synapse/util/retryutils.py
index 5b16a81617..33263fe20f 100644
--- a/synapse/util/retryutils.py
+++ b/synapse/util/retryutils.py
@@ -193,8 +193,9 @@ class RetryDestinationLimiter(object):
         else:
             # We couldn't connect.
             if self.retry_interval:
-                self.retry_interval *= RETRY_MULTIPLIER
-                self.retry_interval *= int(random.uniform(0.8, 1.4))
+                self.retry_interval = int(
+                    self.retry_interval * RETRY_MULTIPLIER * random.uniform(0.8, 1.4)
+                )
 
                 if self.retry_interval >= MAX_RETRY_INTERVAL:
                     self.retry_interval = MAX_RETRY_INTERVAL