fix
This commit is contained in:
parent
98d69fff70
commit
0b6dc3af1a
@ -9,7 +9,7 @@ from utils import queues
|
|||||||
|
|
||||||
class Daemon(base.Daemon):
|
class Daemon(base.Daemon):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(self)
|
super().__init__()
|
||||||
self.telegram_bots: dict[str, dict[str, telebot.TeleBot|None]] = {}
|
self.telegram_bots: dict[str, dict[str, telebot.TeleBot|None]] = {}
|
||||||
self.threads: dict[str, dict[str, threading.Thread|None]] = {}
|
self.threads: dict[str, dict[str, threading.Thread|None]] = {}
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@ class TasksHandlerMixin:
|
|||||||
def poll(self):
|
def poll(self):
|
||||||
while True:
|
while True:
|
||||||
response: tasks_pb2.TakeResponse = self.stub.Take(tasks_pb2.TakeRequest(queue=self.queue_name))
|
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)
|
time.sleep(0.2)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user