0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 11:43:51 +01:00

plateau retries after 1h

This commit is contained in:
Matthew Hodgson 2014-12-10 00:18:44 +00:00
parent faf12b64f8
commit 71da2bed55

View file

@ -890,7 +890,7 @@ class _TransactionQueue(object):
)
deferred.callback(None)
else:
self.start_retrying(destination, retry_interval)
self.set_retrying(destination, retry_interval)
deferred.errback(RuntimeError("Got status %d" % code))
# Ensures we don't continue until all callbacks on that
@ -908,7 +908,7 @@ class _TransactionQueue(object):
logger.warn("TX [%s] Problem in _attempt_transaction: %s",
destination, e)
self.start_retrying(destination, retry_interval)
self.set_retrying(destination, retry_interval)
for deferred in deferreds:
if not deferred.called:
@ -922,11 +922,14 @@ class _TransactionQueue(object):
self._attempt_new_transaction(destination)
@defer.inlineCallbacks
def start_retrying(self, destination, retry_interval):
def set_retrying(self, destination, retry_interval):
# track that this destination is having problems and we should
# give it a chance to recover before trying it again
if retry_interval:
retry_interval *= 2
# plateau at hourly retries for now
if retry_interval >= 60 * 60 * 1000:
retry_interval = 60 * 60 * 1000
else:
retry_interval = 2000 # try again at first after 2 seconds
yield self.store.set_destination_retry_timings(destination,