diff --git a/daemons/poll.py b/daemons/poll.py index a5ad36b..c703c7f 100644 --- a/daemons/poll.py +++ b/daemons/poll.py @@ -9,6 +9,7 @@ from utils import queues class Daemon(base.Daemon): def __init__(self): + super().__init__(self) 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 84338fd..5fdae54 100644 --- a/utils/queues.py +++ b/utils/queues.py @@ -13,8 +13,7 @@ class TasksHandlerMixin: def poll(self): while True: response: tasks_pb2.TakeResponse = self.stub.Take(tasks_pb2.TakeRequest(queue=self.queue_name)) - task = response.task - if not task.id: + if not response.task: time.sleep(0.2) continue try: