Skip to content

Commit e59af6f

Browse files
committed
Make sure metadata gets synced even if transfer to HPC is done
1 parent e25bd15 commit e59af6f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

dataflow_transfer/dataflow_transfer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def process_run(run_dir, sequencer, config):
2222
run.confirm_run_type()
2323

2424
## Transfer already completed. Do nothing.
25-
if run.final_sync_successful and run.has_status("transferred_to_hpc"):
25+
if (
26+
run.final_sync_successful
27+
and run.has_status("transferred_to_hpc")
28+
and not run.metadata_synced #TODO: consider the consequences of this
29+
):
2630
# Check transfer success both in statusdb and via exit code file
2731
# To restart transfer, remove the exit code file
2832
logger.info(f"Transfer of {run_dir} is finished. No action needed.")
@@ -52,8 +56,9 @@ def process_run(run_dir, sequencer, config):
5256

5357
## Final transfer completed successfully. Update statusdb.
5458
if run.final_sync_successful:
55-
logger.info(f"Final transfer completed successfully for {run_dir}.")
56-
run.update_statusdb(status="transferred_to_hpc")
59+
if not run.has_status("transferred_to_hpc"):
60+
logger.info(f"Final transfer completed successfully for {run_dir}.")
61+
run.update_statusdb(status="transferred_to_hpc")
5762
return
5863

5964
## Unknown status of run. Log error and raise exception.

0 commit comments

Comments
 (0)