From ccf34097d88a2de81fe698590b552ce1a12ccbdf Mon Sep 17 00:00:00 2001 From: adkinsrs Date: Tue, 13 Aug 2024 07:40:27 -0400 Subject: [PATCH] try/catch on lock files not found --- www/api/resources/projectr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/api/resources/projectr.py b/www/api/resources/projectr.py index 0440923b..12a6b189 100644 --- a/www/api/resources/projectr.py +++ b/www/api/resources/projectr.py @@ -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: