Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hang on KeyboardInterrupt when running with asyncio. (#95)
* Fix hang on KeyboardInterrupt when running with asyncio. The bare except in the _service_task function also catches and ignores asyncio.CancelledError exceptions. This means the function will never gracefully exit when cancelling the task. The solution I propose here adds an additional except handler specifically for asyncio.CancelledError which will then stop the service task. This allows f.e. aiohttp to cancel all pending tasks and allows the process to terminate even when there are connected clients. * Also exit service task on KeyboardInterrupt.
- Loading branch information