Skip to content

Commit 2074108

Browse files
committed
Update _is_daemon.py
1 parent 01e7e31 commit 2074108

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

yaqd-core/yaqd_core/_is_daemon.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,15 @@ async def shutdown_all(cls, sig, loop):
297297
# This is done after cancelling so that shutdown tasks which require the loop
298298
# are not themselves cancelled.
299299
[d.close() for d in cls._daemons]
300-
tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
300+
tasks = [
301+
t for t in asyncio.all_tasks()
302+
if (
303+
t is not asyncio.current_task()
304+
and "serve_forever" not in t.get_coro().__repr__()
305+
)
306+
]
301307
for task in tasks:
302-
if "serve_forever" in task.get_coro().__repr__():
303-
tasks.pop(tasks.index(task))
308+
logger.info(task.get_coro())
304309
await asyncio.gather(*tasks, return_exceptions=True)
305310
[d._save_state() for d in cls._daemons]
306311
if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP:

0 commit comments

Comments
 (0)