From 96d8621d49e3e6fb615a09d58dc7e898efaad4ed Mon Sep 17 00:00:00 2001 From: estromenko Date: Sun, 9 Nov 2025 15:30:32 +0300 Subject: [PATCH] Remove blocking call in bot method --- vacancies/main/bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vacancies/main/bot.py b/vacancies/main/bot.py index 8a9815f..d360fd9 100644 --- a/vacancies/main/bot.py +++ b/vacancies/main/bot.py @@ -1,5 +1,6 @@ import io import os +import asyncio import traceback from asgiref.sync import sync_to_async @@ -66,7 +67,7 @@ async def next_vacancy(update: Update, context: ContextTypes.DEFAULT_TYPE): await context.bot.send_message(chat_id=update.effective_chat.id, text=message) return - vacancy = get_next_vacancy(customer_cv) + vacancy = await asyncio.to_thread(get_next_vacancy, customer_cv) if not vacancy: message = "Вакансии закончились, возвращайтесь позже!" await context.bot.send_message(chat_id=update.effective_chat.id, text=message)