fix #55

Merged
emmatveev merged 1 commits from master into prod 2025-06-15 03:14:39 +03:00
Showing only changes of commit d45e8c8a35 - Show all commits

View File

@ -1,6 +1,7 @@
import datetime
import os
from threading import Thread
import zoneinfo
import requests
import time
@ -50,14 +51,14 @@ class TasksHandlerMixin:
if not task:
time.sleep(0.2)
continue
start = datetime.datetime.now()
start = datetime.datetime.now().astimezone(zoneinfo.ZoneInfo("Europe/Moscow"))
try:
self.process(task['payload'])
success = True
except Exception as exc:
print(f'Error processing message id={task["id"]}, payload={task["payload"]}, exc={exc}')
success = False
end = datetime.datetime.now()
end = datetime.datetime.now().astimezone(zoneinfo.ZoneInfo("Europe/Moscow"))
try:
resp = requests.post(f'{QUEUES_URL}/api/v1/finish', json={'id': task['id']})
if resp.status_code != 202: