Commit 159473df authored by Lukas Beckmann's avatar Lukas Beckmann Committed by oroulet

only call cleanup task when it exists

parent e5fe2df0
......@@ -154,11 +154,13 @@ class BinaryServer:
transport.close()
# stop cleanup process and run it a last time
self.cleanup_task.cancel()
try:
await self.cleanup_task
except asyncio.CancelledError:
pass
if self.cleanup_task is not None:
self.cleanup_task.cancel()
try:
await self.cleanup_task
except asyncio.CancelledError:
pass
await self._close_tasks()
if self._server:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment