summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-11-20 13:41:20 +0000
committerErik Johnston <erik@matrix.org>2015-11-20 13:41:20 +0000
commit9de1f328adee6bf7a6ed2d8cf8e0e01bcaa5c070 (patch)
tree19607b92796e3b5bc7b4f28a831e6660e454b4a5
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
parentUse min and not max to set an upper bound on retry interval (diff)
downloadsynapse-9de1f328adee6bf7a6ed2d8cf8e0e01bcaa5c070.tar.xz
Merge pull request #393 from matrix-org/erikj/destination_retry_max
Use min and not max to set an upper bound on retry interval
-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)