commit
0e836b1d92
@ -19,10 +19,11 @@ class TasksHandlerMixin:
|
||||
def poll(self):
|
||||
while True:
|
||||
response = requests.get(f'{QUEUES_URL}/api/v1/take', headers={'queue': self.queue_name})
|
||||
if response.status_code == 404:
|
||||
task = response.get('task')
|
||||
if not task:
|
||||
time.sleep(0.2)
|
||||
continue
|
||||
data = response.json()
|
||||
data = task.json()
|
||||
try:
|
||||
self.process(data['payload'])
|
||||
except Exception as exc:
|
||||
|
Loading…
Reference in New Issue
Block a user