Skip to content

Commit

Permalink
Catch OSError, BlockingIOError
Browse files Browse the repository at this point in the history
  • Loading branch information
rernst committed Jan 31, 2024
1 parent a7aea46 commit 8c3fefc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,19 @@ def check_daemon_running(wkdir):


def is_mount_available(mount_name, mount_path, run_file):
if not Path(mount_path).exists():
is_available = True
try:
Path(mount_path).exists()
except (OSError, BlockingIOError):
is_available = False
else:
if not Path(mount_path).exists():
is_available = False

# Send email if mount is not available
if not is_available:
send_mail_lost_mount(mount_name, run_file)
return False
return True
return is_available


def get_transferred_runs(wkdir):
Expand Down

0 comments on commit 8c3fefc

Please sign in to comment.