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