Skip to content

Commit

Permalink
Merge pull request #292 from openclimatefix/fix-copy-old-file-bug
Browse files Browse the repository at this point in the history
try and except around file move
  • Loading branch information
peterdudfield authored Sep 21, 2024
2 parents 7306b9c + 798f8cf commit 18cf725
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions satip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,12 @@ def move_older_files_to_different_location(save_dir: str, history_time: pd.Times
file_time = get_datetime_from_filename(date)

if file_time < history_time:
log.debug("Moving file out of {LATEST_DIR_NAME} folder")
log.debug(f"Moving file out of {LATEST_DIR_NAME} folder")
# Move HRV and non-HRV to new place
filesystem.move(date, f"{save_dir}/{date.split('/')[-1]}")
try:
filesystem.move(date, f"{save_dir}/{date.split('/')[-1]}")
except Exception as _:
log.warn(f'Could not move file {date}')


def check_both_final_files_exists(
Expand Down

0 comments on commit 18cf725

Please sign in to comment.