From 6f604109a5f488b6fe629caa97115ed74d796340 Mon Sep 17 00:00:00 2001 From: Benyamin Ginzburg Date: Wed, 21 Aug 2024 00:21:54 +0300 Subject: [PATCH] Fix event loop --- bus_bot/service/watcher_management_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bus_bot/service/watcher_management_service.py b/bus_bot/service/watcher_management_service.py index f1f2433..8233b74 100644 --- a/bus_bot/service/watcher_management_service.py +++ b/bus_bot/service/watcher_management_service.py @@ -162,7 +162,8 @@ async def _run_worker(self): limiter.put() def run_in_background(self): - self.__worker = asyncio.create_task(self._run_worker()) + loop = asyncio.get_event_loop() + self.__worker = loop.create_task(self._run_worker()) async def close(self): self.__worker.cancel()