Compare commits
No commits in common. "99ceb4c716cb8c08f7118eb1ec871fe252c91c2d" and "3d195df1a743691a9335edeeb8b988ac3026adc5" have entirely different histories.
99ceb4c716
...
3d195df1a7
@ -23,17 +23,18 @@ class TasksHandlerMixin:
|
|||||||
if not task:
|
if not task:
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
continue
|
continue
|
||||||
|
data = task.json()
|
||||||
try:
|
try:
|
||||||
self.process(task['payload'])
|
self.process(data['payload'])
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
print(f'Error processing message id={task["id"]}, payload={task["payload"]}, exc={exc}')
|
print(f'Error processing message id={data["id"]}, payload={data["payload"]}, exc={exc}')
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
resp = requests.post(f'{QUEUES_URL}/api/v1/finish', json={'id': data['id']})
|
resp = requests.post(f'{QUEUES_URL}/api/v1/finish', json={'id': data['id']})
|
||||||
if resp.status_code != 202:
|
if resp.status_code != 202:
|
||||||
raise QueuesException
|
raise QueuesException
|
||||||
except:
|
except:
|
||||||
print(f'Failed to finish task id={task["id"]}')
|
print(f'Failed to finish task id={data["id"]}')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def queue_name(self):
|
def queue_name(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user