Skip to content

Commit

Permalink
try/catch on lock files not found
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Aug 13, 2024
1 parent 64407f9 commit ccf3409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion www/api/resources/projectr.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def remove_lock_file(fd, filepath):
"""Release the lock file."""
#fcntl.flock(fd, fcntl.LOCK_UN)
fd.close()
Path(filepath).unlink()
try:
Path(filepath).unlink()
except FileNotFoundError:
# This is fine, as the lock file may have been removed by another process
pass

def write_to_json(projections_dict, projection_json_file):
with open(projection_json_file, 'w') as f:
Expand Down

0 comments on commit ccf3409

Please sign in to comment.