diff --git a/webservice/job_monitor.py b/webservice/job_monitor.py index 037575d8e18969b43cac21ac1e0c0b90b3bcd956..d0662a20351a9cca97797f919142d16dfc2b7ed2 100644 --- a/webservice/job_monitor.py +++ b/webservice/job_monitor.py @@ -285,12 +285,11 @@ class JobsMonitor: status = 'F' if success else 'E' # Finished/Error 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""" - data = {'cal_pipeline_reply': msg} - if status != 'R': + data = {'cal_pipeline_reply': msg, 'flg_cal_data_status': status} + if status != 'IP': 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) if response.status_code != 200: log.error("Failed to update MDC run id %s", run_id) diff --git a/webservice/webservice.py b/webservice/webservice.py index 25c3d1fe6a06dc1c2286518b9866f21a3905fdb4..dda291c2e48d9ab5ef1fca10f3422daf17a75158 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -744,7 +744,7 @@ async def update_mdc_status(mdc: MetadataClient, action: str, if message.split(':')[0] in ('FAILED', 'WARN'): # Errors flag = 'E' elif message.split(':')[0] == 'SUCCESS': # Success - flag = 'R' if action == 'correct' else 'IP' + flag = 'IP' if 'Uploaded' in message or 'Finished' in message: flag = 'A' if action == 'correct' else 'F' else: # MDC Timeout @@ -753,8 +753,8 @@ async def update_mdc_status(mdc: MetadataClient, action: str, if action == 'correct': func = mdc.update_run_api data = {'cal_pipeline_reply': message} - # Don't send the 'R' status, as this may trigger another correction - if flag != 'R': + # Don't send In Progress; job_monitor will send this when jobs start. + if flag != 'IP': data['flg_cal_data_status'] = flag elif action == 'dark_request':