mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 06:59:25 -05:00
fix stupid syntax thinkos
This commit is contained in:
parent
aed62a3583
commit
5cd43d4b9f
@ -866,7 +866,7 @@ class _TransactionQueue(object):
|
|||||||
if code == 200:
|
if code == 200:
|
||||||
deferred.callback(None)
|
deferred.callback(None)
|
||||||
else:
|
else:
|
||||||
start_retrying(destination, retry_interval)
|
self.start_retrying(destination, retry_interval)
|
||||||
deferred.errback(RuntimeError("Got status %d" % code))
|
deferred.errback(RuntimeError("Got status %d" % code))
|
||||||
|
|
||||||
# Ensures we don't continue until all callbacks on that
|
# Ensures we don't continue until all callbacks on that
|
||||||
@ -883,7 +883,7 @@ class _TransactionQueue(object):
|
|||||||
# for this finishing functions deferred.
|
# for this finishing functions deferred.
|
||||||
logger.exception("TX [%s] Problem in _attempt_transaction: %s", destination, e)
|
logger.exception("TX [%s] Problem in _attempt_transaction: %s", destination, e)
|
||||||
|
|
||||||
start_retrying(destination, retry_interval)
|
self.start_retrying(destination, retry_interval)
|
||||||
|
|
||||||
for deferred in deferreds:
|
for deferred in deferreds:
|
||||||
if not deferred.called:
|
if not deferred.called:
|
||||||
@ -896,13 +896,12 @@ class _TransactionQueue(object):
|
|||||||
# Check to see if there is anything else to send.
|
# Check to see if there is anything else to send.
|
||||||
self._attempt_new_transaction(destination)
|
self._attempt_new_transaction(destination)
|
||||||
|
|
||||||
def start_retrying(destination, retry_interval):
|
def start_retrying(self, destination, retry_interval):
|
||||||
# track that this destination is having problems and we should
|
# track that this destination is having problems and we should
|
||||||
# give it a chance to recover before trying it again
|
# give it a chance to recover before trying it again
|
||||||
if retry_interval:
|
if retry_interval:
|
||||||
retry_interval *= 2
|
retry_interval *= 2
|
||||||
else:
|
else:
|
||||||
retry_interval = 2 # try again at first after 2 seconds
|
retry_interval = 2 # try again at first after 2 seconds
|
||||||
self.store.set_destination_retry_timings(destination,
|
self.store.set_destination_retry_timings(destination,
|
||||||
int(self._clock.time_msec()), retry_interval)
|
int(self._clock.time_msec()), retry_interval)
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ class TransactionStore(SQLBaseStore):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def set_destination_retry_timings(self, destination):
|
def set_destination_retry_timings(self, destination, retry_last_ts, retry_interval):
|
||||||
"""Sets the current retry timings for a given destination.
|
"""Sets the current retry timings for a given destination.
|
||||||
Both timings should be zero if retrying is no longer occuring.
|
Both timings should be zero if retrying is no longer occuring.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user