Skip to content

Commit

Permalink
exit service task if event loop is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Feb 19, 2019
1 parent 68ca0c2 commit ee6e00d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engineio/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,5 +419,10 @@ async def _service_task(self): # pragma: no cover
self.logger.info('service task canceled')
break
except:
if asyncio.get_event_loop().is_closed():
self.logger.info('event loop is closed, exiting service '
'task')
break

# an unexpected exception has occurred, log it and continue
self.logger.exception('service task exception')

0 comments on commit ee6e00d

Please sign in to comment.