File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1502,6 +1502,26 @@ async def process_gain(
15021502 / secure_filename (visit_name )
15031503 / machine_config .gain_directory_name
15041504 )
1505+
1506+ # Check under previous year if the folder doesn't exist
1507+ if not filepath .exists ():
1508+ filepath_prev = filepath
1509+ filepath = (
1510+ Path (machine_config .rsync_basepath )
1511+ / (machine_config .rsync_module or "data" )
1512+ / str (datetime .datetime .now ().year - 1 )
1513+ / secure_filename (visit_name )
1514+ / machine_config .gain_directory_name
1515+ )
1516+ # If it's not in the previous year, it's a genuine error
1517+ if not filepath .exists ():
1518+ log_message = (
1519+ "Unable to find gain reference directory under "
1520+ f"{ str (filepath_prev )!r} or { str (filepath )} "
1521+ )
1522+ log .error (log_message )
1523+ raise FileNotFoundError (log_message )
1524+
15051525 if gain_reference_params .eer :
15061526 new_gain_ref , new_gain_ref_superres = await prepare_eer_gain (
15071527 filepath / safe_path_name ,
You can’t perform that action at this time.
0 commit comments