diff --git a/bin/distribute.py b/bin/distribute.py index 5a4165af..06b43b50 100644 --- a/bin/distribute.py +++ b/bin/distribute.py @@ -91,6 +91,7 @@ def launch_fink_mm(spark, args: dict): # Wait for GCN comming time_spent_in_wait = 0 + stream_distrib_list = [] while time_spent_in_wait < args.exit_after: mm_path_output = config["PATH"]["online_grb_data_prefix"] mmtmpdatapath = os.path.join(mm_path_output, "online") @@ -105,10 +106,13 @@ def launch_fink_mm(spark, args: dict): time_spent_in_wait += 1 time.sleep(1.0) - _LOG.info("Time spent in waiting for Fink-MM: {time_spent_in_wait} seconds") + if stream_distrib_list == []: + _LOG.warning(f"{mmtmpdatapath} does not exist. mm2distribute could not start before the end of the job.") + else: + _LOG.info("Time spent in waiting for Fink-MM: {time_spent_in_wait} seconds") return time_spent_in_wait, stream_distrib_list - _LOG.info("No configuration found for fink-mm -- no applied") + _LOG.warning("No configuration found for fink-mm -- not applied") return 0, [] diff --git a/bin/raw2science.py b/bin/raw2science.py index 00c53b64..c88367ea 100644 --- a/bin/raw2science.py +++ b/bin/raw2science.py @@ -80,6 +80,7 @@ def launch_fink_mm(args: dict, scitmpdatapath: str): # Wait for GCN comming time_spent_in_wait = 0 + countquery_mm = None while time_spent_in_wait < args.exit_after: # if there is gcn and ztf data if path_exist(gcn_path) and path_exist(scitmpdatapath): @@ -93,10 +94,14 @@ def launch_fink_mm(args: dict, scitmpdatapath: str): # wait for comming GCN time_spent_in_wait += 1 time.sleep(1) - _LOG.info("Time spent in waiting for Fink-MM: {time_spent_in_wait} seconds") + + if countquery_mm is None: + _LOG.warning("science2mm could not start before the end of the job.") + else: + _LOG.info("Time spent in waiting for Fink-MM: {time_spent_in_wait} seconds") return time_spent_in_wait, countquery_mm - _LOG.info("No configuration found for fink-mm -- no applied") + _LOG.warning("No configuration found for fink-mm -- not applied") return 0, None