Skip to content

Commit

Permalink
uniform service task cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Feb 11, 2019
1 parent c60499e commit 82f6982
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engineio/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ async def _service_task(self): # pragma: no cover
if not socket.closing and not socket.closed:
await socket.check_ping_timeout()
await self.sleep(sleep_interval)
except (KeyboardInterrupt, asyncio.CancelledError):
self.logger.debug('service task cancelled')
except (SystemExit, KeyboardInterrupt, asyncio.CancelledError):
self.logger.info('service task canceled')
break
except:
# an unexpected exception has occurred, log it and continue
Expand Down
1 change: 1 addition & 0 deletions engineio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ def _service_task(self): # pragma: no cover
s.check_ping_timeout()
self.sleep(sleep_interval)
except (SystemExit, KeyboardInterrupt):
self.logger.info('service task canceled')
break
except:
# an unexpected exception has occurred, log it and continue
Expand Down

0 comments on commit 82f6982

Please sign in to comment.