diff --git a/webservice/webservice.py b/webservice/webservice.py index 3c1fc1b1f063c3ac28390c177bffad164512a62c..a2da66c66e526ef2d8339bbc2f6b4d78ad64f220 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -462,36 +462,6 @@ def update_job_db(config): time.sleep(time_interval) -# Do not copy over files of big detectors when they are not being -# corrected. -copy_blocklist_pattern = re.compile( - r'\S*RAW-R\d{4}-(AGIPD|LPD|DSSC)\d{2}-S\d{5}.h5$') - - -async def copy_untouched_files(files_set): - """ Copy those files which are not touched by the calibration - to the output directory. - - :param file_list: The list of files to copy - - Copying is done via an asyncio subprocess call - """ - if files_set: - Path(next(iter(files_set)).replace("raw", "proc")).parent.mkdir( - parents=True, exist_ok=True) - else: - return - - for f in files_set: - if copy_blocklist_pattern.match(f): - continue - - of = f.replace("raw", "proc").replace("RAW", "CORR") - cmd = ["rsync", "-av", f, of] - await asyncio.subprocess.create_subprocess_shell(" ".join(cmd)) - logging.info(f"Copying {f} to {of}") - - async def run_action(job_db, cmd, mode, proposal, run, rid) -> str: """Run action command (CORRECT or DARK). @@ -893,17 +863,12 @@ class ActionsServer: # Prepare configs for all detectors in run fl = glob.glob(f"{rpath}/*.h5") - corr_file_list = set() - copy_file_list = set(fl) detectors = {} for karabo_id in pconf: dconfig = data_conf[karabo_id] # check for files according to mapping in raw run dir. if any(y in x for x in fl for y in dconfig['karabo-da']): - for karabo_da in dconfig['karabo-da']: - tfl = glob.glob(f"{rpath}/*{karabo_da}*.h5") - corr_file_list = corr_file_list.union(set(tfl)) thisconf = copy.copy(dconfig) if isinstance(pconf[karabo_id], dict): thisconf.update(copy.copy(pconf[karabo_id])) @@ -913,8 +878,7 @@ class ActionsServer: thisconf["run"] = runnr detectors[karabo_id] = thisconf - copy_file_set = copy_file_list.difference(corr_file_list) - asyncio.ensure_future(copy_untouched_files(copy_file_set)) + except Exception as corr_e: logging.error("Error during correction", exc_info=corr_e) await update_mdc_status(self.mdc, 'correct', rid,