From 69b65e097e0783fb9331aeb35318ed2bb033fd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=98=D0=B2?= =?UTF-8?q?=D0=B0=D1=85=D0=BD=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 29 Dec 2023 01:00:42 +0300 Subject: [PATCH] Set uvloop for current thread explicitly. --- taskiq/cli/worker/run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taskiq/cli/worker/run.py b/taskiq/cli/worker/run.py index 09c71b0..055148e 100644 --- a/taskiq/cli/worker/run.py +++ b/taskiq/cli/worker/run.py @@ -117,7 +117,9 @@ def interrupt_handler(signum: int, _frame: Any) -> None: loop = uvloop.new_event_loop() # type: ignore else: loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) + + asyncio.set_event_loop(loop) + # This option signals that current # broker is running as a worker. # We must set this field before importing tasks,