feat: separate queue and webserver shutdown
This commit is contained in:
parent
235e27b74c
commit
61a6d0eeed
@ -34,11 +34,14 @@ async def graceful_shutdown(manager: AsyncQueueManager, queue_task, webserver_ta
|
|||||||
if queue_task and not queue_task.done():
|
if queue_task and not queue_task.done():
|
||||||
queue_task.cancel()
|
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():
|
if webserver_task and not webserver_task.done():
|
||||||
webserver_task.cancel()
|
webserver_task.cancel()
|
||||||
|
|
||||||
# explicitly shutdown manager and webserver
|
# await webserver shutdown
|
||||||
await asyncio.gather(queue_task, manager.shutdown(), webserver_task, return_exceptions=True)
|
await asyncio.gather(webserver_task, return_exceptions=True)
|
||||||
|
|
||||||
logger.info("Shutdown complete.")
|
logger.info("Shutdown complete.")
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyinfra"
|
name = "pyinfra"
|
||||||
version = "3.3.4"
|
version = "3.3.5"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Team Research <research@knecon.com>"]
|
authors = ["Team Research <research@knecon.com>"]
|
||||||
license = "All rights reseverd"
|
license = "All rights reseverd"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user