Skip to content
Snippets Groups Projects
Commit c4850c8c authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Replace 'R' status for correction with 'IP'

parent c154570c
No related branches found
No related tags found
1 merge request!800Send 'E' and 'IP' statuses to myMdC for correction jobs
...@@ -285,12 +285,11 @@ class JobsMonitor: ...@@ -285,12 +285,11 @@ class JobsMonitor:
status = 'F' if success else 'E' # Finished/Error status = 'F' if success else 'E' # Finished/Error
self.mymdc_update_dark(r['mymdc_id'], msg, status) self.mymdc_update_dark(r['mymdc_id'], msg, status)
def mymdc_update_run(self, run_id, msg, status='R'): def mymdc_update_run(self, run_id, msg, status='IP'):
"""Update correction status in MyMdC""" """Update correction status in MyMdC"""
data = {'cal_pipeline_reply': msg} data = {'cal_pipeline_reply': msg, 'flg_cal_data_status': status}
if status != 'R': if status != 'IP':
data['cal_last_end_at'] = datetime.now(tz=timezone.utc).isoformat() data['cal_last_end_at'] = datetime.now(tz=timezone.utc).isoformat()
data['flg_cal_data_status'] = status
response = self.mdc.update_run_api(run_id, data) response = self.mdc.update_run_api(run_id, data)
if response.status_code != 200: if response.status_code != 200:
log.error("Failed to update MDC run id %s", run_id) log.error("Failed to update MDC run id %s", run_id)
......
...@@ -744,7 +744,7 @@ async def update_mdc_status(mdc: MetadataClient, action: str, ...@@ -744,7 +744,7 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
if message.split(':')[0] in ('FAILED', 'WARN'): # Errors if message.split(':')[0] in ('FAILED', 'WARN'): # Errors
flag = 'E' flag = 'E'
elif message.split(':')[0] == 'SUCCESS': # Success elif message.split(':')[0] == 'SUCCESS': # Success
flag = 'R' if action == 'correct' else 'IP' flag = 'IP'
if 'Uploaded' in message or 'Finished' in message: if 'Uploaded' in message or 'Finished' in message:
flag = 'A' if action == 'correct' else 'F' flag = 'A' if action == 'correct' else 'F'
else: # MDC Timeout else: # MDC Timeout
...@@ -753,8 +753,8 @@ async def update_mdc_status(mdc: MetadataClient, action: str, ...@@ -753,8 +753,8 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
if action == 'correct': if action == 'correct':
func = mdc.update_run_api func = mdc.update_run_api
data = {'cal_pipeline_reply': message} data = {'cal_pipeline_reply': message}
# Don't send the 'R' status, as this may trigger another correction # Don't send In Progress; job_monitor will send this when jobs start.
if flag != 'R': if flag != 'IP':
data['flg_cal_data_status'] = flag data['flg_cal_data_status'] = flag
elif action == 'dark_request': elif action == 'dark_request':
......
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