Compare commits

..

No commits in common. "860e06226ab56d43908291f054349c33df74bda6" and "944ac1301b3ee2b53dd6970f75f43b9ca315a9fb" have entirely different histories.

View File

@ -1,7 +1,6 @@
import datetime
import os
from threading import Thread
import zoneinfo
import requests
import time
@ -51,14 +50,14 @@ class TasksHandlerMixin:
if not task:
time.sleep(0.2)
continue
start = datetime.datetime.now().astimezone(zoneinfo.ZoneInfo("Europe/Moscow"))
start = datetime.datetime.now()
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().astimezone(zoneinfo.ZoneInfo("Europe/Moscow"))
end = datetime.datetime.now()
try:
resp = requests.post(f'{QUEUES_URL}/api/v1/finish', json={'id': task['id']})
if resp.status_code != 202: