summary refs log tree commit diff
path: root/synapse/http/matrixfederationclient.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-11-20 09:34:58 +0000
committerErik Johnston <erik@matrix.org>2015-11-20 09:34:58 +0000
commit2f2bbb4d063501d9e07e824fb4533b62c55b93ad (patch)
tree16f7e585b0e5941d886e41c5171f12fc0242c4c2 /synapse/http/matrixfederationclient.py
parentMerge branch 'hotfixes-v0.11.0-r2' of github.com:matrix-org/synapse (diff)
downloadsynapse-2f2bbb4d063501d9e07e824fb4533b62c55b93ad.tar.xz
Use min and not max to set an upper bound on retry interval
Diffstat (limited to '')
-rw-r--r--synapse/http/matrixfederationclient.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 614c06a6d7..4e6572df72 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -190,11 +190,11 @@ class MatrixFederationHttpClient(object):
                     if retries_left and not timeout:
                         if long_retries:
                             delay = 4 ** (MAX_LONG_RETRIES + 1 - retries_left)
-                            delay = max(delay, 60)
+                            delay = min(delay, 60)
                             delay *= random.uniform(0.8, 1.4)
                         else:
                             delay = 0.5 * 2 ** (MAX_SHORT_RETRIES - retries_left)
-                            delay = max(delay, 2)
+                            delay = min(delay, 2)
                             delay *= random.uniform(0.8, 1.4)
 
                         yield sleep(delay)