From 95af779729259fafd6e1ff6a0032d6a6c4890a56 Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Sun, 21 Aug 2022 23:05:20 +0300 Subject: [PATCH] all tasks to loop not queue --- app/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 0dc32aa..8d2cac9 100644 --- a/app/main.py +++ b/app/main.py @@ -27,7 +27,8 @@ queue = asyncio.Queue() # type: ignore async def bot_startup() -> None: await bot.set_webhook(WEBHOOK_URL) - asyncio.create_task(get_updates_from_queue()) + loop = asyncio.get_running_loop() + loop.create_task(get_updates_from_queue()) logger.info(f'Webhook set to {WEBHOOK_URL}'.replace(API_TOKEN, '{BOT_API_TOKEN}')) asyncio_schedule()