Skip to content

Commit

Permalink
Improve verbosity when trying to launch fink-mm
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed May 27, 2024
1 parent 77e2406 commit ab6fd60
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bin/distribute.py
Original file line number Diff line number Diff line change
@@ -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, []


9 changes: 7 additions & 2 deletions bin/raw2science.py
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit ab6fd60

Please sign in to comment.