From 61a6d0eeed81fa463b96ad18bbdebdb7246f9376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20K=C3=B6ssler?= Date: Wed, 13 Nov 2024 17:02:21 +0100 Subject: [PATCH] feat: separate queue and webserver shutdown --- pyinfra/examples.py | 7 +++++-- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyinfra/examples.py b/pyinfra/examples.py index 407f389..f33e9ae 100644 --- a/pyinfra/examples.py +++ b/pyinfra/examples.py @@ -34,11 +34,14 @@ async def graceful_shutdown(manager: AsyncQueueManager, queue_task, webserver_ta if queue_task and not queue_task.done(): queue_task.cancel() + # await queue manager shutdown + await asyncio.gather(queue_task, manager.shutdown(), return_exceptions=True) + if webserver_task and not webserver_task.done(): webserver_task.cancel() - # explicitly shutdown manager and webserver - await asyncio.gather(queue_task, manager.shutdown(), webserver_task, return_exceptions=True) + # await webserver shutdown + await asyncio.gather(webserver_task, return_exceptions=True) logger.info("Shutdown complete.") diff --git a/pyproject.toml b/pyproject.toml index c93a231..04ac98e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyinfra" -version = "3.3.4" +version = "3.3.5" description = "" authors = ["Team Research "] license = "All rights reseverd"