speed
This commit is contained in:
parent
2f6ada10ad
commit
f0abdf7c28
|
@ -177,7 +177,7 @@ class TransitWebSockets(unittest.TestCase):
|
||||||
|
|
||||||
done = Deferred()
|
done = Deferred()
|
||||||
last_produce = None
|
last_produce = None
|
||||||
timeout = 3 # seconds
|
timeout = 2 # seconds
|
||||||
|
|
||||||
def asked_for_data():
|
def asked_for_data():
|
||||||
nonlocal last_produce
|
nonlocal last_produce
|
||||||
|
@ -192,8 +192,8 @@ class TransitWebSockets(unittest.TestCase):
|
||||||
if reactor.seconds() - last_produce > timeout:
|
if reactor.seconds() - last_produce > timeout:
|
||||||
done.callback(None)
|
done.callback(None)
|
||||||
return
|
return
|
||||||
# recursive call to ourselves to check again in a second
|
# recursive call to ourselves to check again soon
|
||||||
reactor.callLater(1, check_if_done)
|
reactor.callLater(.1, check_if_done)
|
||||||
check_if_done()
|
check_if_done()
|
||||||
|
|
||||||
yield done
|
yield done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user