From 0b6dc3af1aaf103225fa856842299c581c2a468e Mon Sep 17 00:00:00 2001 From: emmatveev Date: Sun, 8 Dec 2024 13:45:11 +0300 Subject: [PATCH] fix --- daemons/poll.py | 2 +- utils/queues.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemons/poll.py b/daemons/poll.py index c703c7f..eb84fd4 100644 --- a/daemons/poll.py +++ b/daemons/poll.py @@ -9,7 +9,7 @@ from utils import queues class Daemon(base.Daemon): def __init__(self): - super().__init__(self) + super().__init__() self.telegram_bots: dict[str, dict[str, telebot.TeleBot|None]] = {} self.threads: dict[str, dict[str, threading.Thread|None]] = {} diff --git a/utils/queues.py b/utils/queues.py index 5fdae54..29aee61 100644 --- a/utils/queues.py +++ b/utils/queues.py @@ -13,7 +13,8 @@ class TasksHandlerMixin: def poll(self): while True: response: tasks_pb2.TakeResponse = self.stub.Take(tasks_pb2.TakeRequest(queue=self.queue_name)) - if not response.task: + task = response.task + if not task: time.sleep(0.2) continue try: