diff options
-rw-r--r-- | crocoite/controller.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py index 1ee1943..f8b1420 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -171,7 +171,7 @@ class SinglePageController: while True: idleProc = asyncio.ensure_future (l.idle.wait ()) try: - finished, pending = await asyncio.wait([idleProc, timeoutProc], + finished, pending = await asyncio.wait([idleProc, timeoutProc, handle], return_when=asyncio.FIRST_COMPLETED, timeout=idleTimeout) except asyncio.CancelledError: idleProc.cancel () @@ -183,6 +183,12 @@ class SinglePageController: idleProc.cancel () timeoutProc.cancel () break + elif handle in finished: + # something went wrong while processing the data + idleProc.cancel () + timeoutProc.cancel () + handle.result () + assert False # previous line should always raise Exception elif timeoutProc in finished: # global timeout idleProc.cancel () |