refactor: function naming
This commit is contained in:
parent
564f2cbb43
commit
1e939febc2
@ -20,16 +20,11 @@ from pyinfra.webserver.utils import (
|
||||
)
|
||||
|
||||
|
||||
async def run_async_tasks(manager, webserver):
|
||||
async def run_async_queues(manager, webserver):
|
||||
"""Run the webserver and the async queue manager concurrently."""
|
||||
|
||||
# Start the web server as an async task
|
||||
webserver_task = asyncio.create_task(webserver)
|
||||
|
||||
# Start the async queue manager
|
||||
queue_manager_task = asyncio.create_task(manager.run())
|
||||
|
||||
# Wait for both tasks to complete (typically, they run indefinitely)
|
||||
await asyncio.gather(webserver_task, queue_manager_task)
|
||||
|
||||
|
||||
@ -88,7 +83,7 @@ def start_standard_queue_consumer(
|
||||
|
||||
if isinstance(manager, AsyncQueueManager):
|
||||
webserver = create_webserver_task_from_settings(app, settings)
|
||||
asyncio.run(run_async_tasks(manager, webserver))
|
||||
asyncio.run(run_async_queues(manager, webserver))
|
||||
elif isinstance(manager, QueueManager):
|
||||
webserver = create_webserver_thread_from_settings(app, settings)
|
||||
webserver.start()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user