diff --git a/webservice/webservice.py b/webservice/webservice.py index fd155ec4c4c5e641d6c412fd4b8143c860b6cdd8..b77183891ddf8320d07a0b55579f289315d4c60b 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -15,7 +15,7 @@ import sys import time import urllib.parse from asyncio import get_event_loop, shield -from datetime import datetime +from datetime import datetime, timezone from pathlib import Path from subprocess import PIPE, run from threading import Thread @@ -427,6 +427,10 @@ def update_job_db(config): except KafkaError: logging.warning("Error sending Kafka notification", exc_info=True) + mdc.update_run_api( + rid, # The result from MyMDC does not matter here. + {'cal_last_end_at': datetime.now(tz=timezone.utc).isoformat()} + ) msg = "\n".join(statii) msg_debug = f"Update MDC {rid}, {msg}" logging.debug(msg_debug.replace('\n', ', ')) @@ -928,6 +932,11 @@ class ActionsServer: request_time, ) await update_mdc_status(self.mdc, 'correct', rid, ret) + loop = get_event_loop() + await loop.run_in_executor( + None, self.mdc.update_run_api, + rid, {'cal_last_begin_at': datetime.now(tz=timezone.utc).isoformat()} + ) # END of part to run after sending reply asyncio.ensure_future(_continue())