summary refs log tree commit diff
path: root/synapse/appservice/scheduler.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-03-06 16:41:19 +0000
committerKegan Dougal <kegan@matrix.org>2015-03-06 16:41:19 +0000
commit64345b75597cba56e12a172fb227ac2c67993bbd (patch)
treef1c3547f6dde6b50c2130058269c599f26c9ecf9 /synapse/appservice/scheduler.py
parentUpdate UTs (diff)
downloadsynapse-64345b75597cba56e12a172fb227ac2c67993bbd.tar.xz
Upper bound the backoff.
Diffstat (limited to '')
-rw-r--r--synapse/appservice/scheduler.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py
index 514148c947..ee5978da6e 100644
--- a/synapse/appservice/scheduler.py
+++ b/synapse/appservice/scheduler.py
@@ -214,7 +214,9 @@ class _Recoverer(object):
                 self.backoff_counter = 1
                 yield self.retry()
             else:
-                self.backoff_counter += 1
+                # cap the backoff to be around 18h => (2^16) = 65536 secs
+                if self.backoff_counter < 16:
+                    self.backoff_counter += 1
                 self.recover()
         else:
             self._set_service_recovered()