Skip to content

Commit

Permalink
Fix event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Benyamin Ginzburg committed Aug 20, 2024
1 parent ce3c19e commit 6f60410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bus_bot/service/watcher_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6f60410

Please sign in to comment.