mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04: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():
|
||||
timed_out[0] = True
|
||||
deferred.cancel()
|
||||
|
||||
if not new_d.called:
|
||||
new_d.errback(DeferredTimeoutError(timeout, "Deferred"))
|
||||
|
||||
deferred.cancel()
|
||||
|
||||
delayed_call = reactor.callLater(timeout, time_it_out)
|
||||
|
||||
def convert_cancelled(value):
|
||||
|
Loading…
Reference in New Issue
Block a user