mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-15 12:17:48 +00: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
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue