Skip to content

Commit

Permalink
try and except around file move
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Sep 19, 2024
1 parent 2198dff commit 798f8cf
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 798f8cf

Please sign in to comment.