Merge pull request 'fix' (#26) from master into dev

Reviewed-on: #26
This commit is contained in:
emmatveev 2024-11-27 02:33:29 +03:00
commit 99ceb4c716

View File

@ -23,18 +23,17 @@ class TasksHandlerMixin:
if not task:
time.sleep(0.2)
continue
data = task.json()
try:
self.process(data['payload'])
self.process(task['payload'])
except Exception as exc:
print(f'Error processing message id={data["id"]}, payload={data["payload"]}, exc={exc}')
print(f'Error processing message id={task["id"]}, payload={task["payload"]}, exc={exc}')
continue
try:
resp = requests.post(f'{QUEUES_URL}/api/v1/finish', json={'id': data['id']})
if resp.status_code != 202:
raise QueuesException
except:
print(f'Failed to finish task id={data["id"]}')
print(f'Failed to finish task id={task["id"]}')
@property
def queue_name(self):