diff --git a/webservice/messages.py b/webservice/messages.py index 2c586a3a8f3c70bc4723c685c9a86de4b5b3d71f..e9bbc571d6d7204d3c4c40c35fefbf2b8e7ad939 100644 --- a/webservice/messages.py +++ b/webservice/messages.py @@ -5,6 +5,7 @@ class Errors: UNKNOWN_ACTION = "FAILED: action {} is not known!, please contact det-support@xfel.eu" PATH_NOT_FOUND = "FAILED: run at {} not found!, please contact det-support@xfel.eu" NOTHING_TO_DO = "WARN: nothing to calibrate in path {}, please contact det-support@xfel.eu" + NOTHING_TO_REDO = "WARN: nothing to re-calibrate in path {}, please contact det-support@xfel.eu" CONFIG_ERROR = "FAILED: configuration at {} couldn't be parsed, using default!, please contact det-support@xfel.eu" CONFIG_NOT_FOUND = "WARN: configuration at {} not found, using default!, please contact det-support@xfel.eu" NO_DEFAULT_CONFIG = "FAILED: No default config for instrument {}, detector {} exists!, please contact det-support@xfel.eu" diff --git a/webservice/webservice.py b/webservice/webservice.py index eb539d951a9957fd5e38a9ed8084ec0b5fa19676..8f79a374aa9bc77c2068655eff3178c696195604 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -1279,20 +1279,21 @@ class ActionsServer: ) return msg.encode() + if len(mddirs_by_krb_id) == 0: + in_folder = self.config['correct']['in-folder'].format( + instrument=instrument, cycle=cycle, proposal=proposal) + rpath = os.path.join(in_folder, f"r{int(runnr):04d}/") + msg = Errors.NOTHING_TO_REDO.format(rpath) + logging.warning(msg) + asyncio.ensure_future( + update_mdc_status(self.mdc, 'correct', rid, msg)) + return msg.encode() + queued_msg = Success.REPROD_QUEUED.format(proposal, [runnr]) logging.debug(queued_msg) async def _continue(): """Runs in the background after we reply to the ZMQ request""" - if len(mddirs_by_krb_id) == 0: - in_folder = self.config['correct']['in-folder'].format( - instrument=instrument, cycle=cycle, proposal=proposal) - rpath = os.path.join(in_folder, f"r{int(runnr):04d}/") - msg = Errors.NOTHING_TO_DO.format(rpath) - logging.warning(msg) - await update_mdc_status(self.mdc, 'correct', rid, msg) - return - await update_mdc_status(self.mdc, 'correct', rid, queued_msg) ret = []