mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 10:19:21 -05:00
Fix timeout function
Turns out deferred.cancel sometimes throws, so we do that last to ensure that we always do resolve the new deferred.
This commit is contained in:
parent
c30cfff572
commit
24efb2a70d
@ -456,11 +456,12 @@ def timeout_no_seriously(deferred, timeout, reactor):
|
|||||||
|
|
||||||
def time_it_out():
|
def time_it_out():
|
||||||
timed_out[0] = True
|
timed_out[0] = True
|
||||||
deferred.cancel()
|
|
||||||
|
|
||||||
if not new_d.called:
|
if not new_d.called:
|
||||||
new_d.errback(DeferredTimeoutError(timeout, "Deferred"))
|
new_d.errback(DeferredTimeoutError(timeout, "Deferred"))
|
||||||
|
|
||||||
|
deferred.cancel()
|
||||||
|
|
||||||
delayed_call = reactor.callLater(timeout, time_it_out)
|
delayed_call = reactor.callLater(timeout, time_it_out)
|
||||||
|
|
||||||
def convert_cancelled(value):
|
def convert_cancelled(value):
|
||||||
|
Loading…
Reference in New Issue
Block a user