Skip to content
Snippets Groups Projects
Commit 04fac40f authored by Cyril Danilevski's avatar Cyril Danilevski
Browse files

Update MyMDC with calibration begin and end times

parent cdca2f98
No related branches found
No related tags found
1 merge request!560[webservice] Update MyMDC with begin and end times
......@@ -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())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment