fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 8s
Deploy Dev / Push (pull_request) Successful in 10s
Deploy Dev / Deploy dev (pull_request) Successful in 9s

This commit is contained in:
emmatveev 2024-12-08 13:45:11 +03:00
parent 98d69fff70
commit 0b6dc3af1a
2 changed files with 3 additions and 2 deletions

View File

@ -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]] = {}

View File

@ -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: