diff --git a/webservice/webservice.py b/webservice/webservice.py index 256947fd240f478057886c537713c90dcb161476..494608fd7223efa1ce10ce873d3eeb0e03af3476 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -1087,11 +1087,18 @@ class ActionsServer: request_time ) await update_mdc_status(self.mdc, 'dark_request', rid, ret) - if report_path is None: + if len(report_path) == 0: logging.warning("Failed to identify report path for dark_request") else: - await update_darks_paths(self.mdc, rid, in_folder, - out_folder, report_path) + if len(report_path) > 1: + logging.warning( + "More than one report path is returned. " + "Updating myMDC with the first report path only." + ) + await update_darks_paths( + self.mdc, rid, in_folder, + out_folder, report_path[0] + ) # END of part to run after sending reply asyncio.ensure_future(_continue()) @@ -1162,7 +1169,7 @@ class ActionsServer: async def launch_jobs( self, run_nrs, rid, detectors, action, instrument, cycle, proposal, request_time - ) -> (str, Optional[str]): + ) -> (str, List[str]): report = [] ret = [] # run xfel_calibrate @@ -1190,7 +1197,7 @@ class ActionsServer: report_idx = cmd.index('--report-to') + 1 report.append(cmd[report_idx] + '.pdf') # return string without a tailing comma. - return ", ".join(ret), ", ".join(report) if len(report)!=0 else None + return ", ".join(ret), report parser = argparse.ArgumentParser( description='Start the calibration webservice')