From 378ce639bc6234ddb82a1e5219cb22da4d53a1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 4 Jun 2024 11:56:58 +0200 Subject: [PATCH] chg: Avoid unnecessary critical log. --- lookyloo/helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lookyloo/helpers.py b/lookyloo/helpers.py index 01ee29ad..74b0f265 100644 --- a/lookyloo/helpers.py +++ b/lookyloo/helpers.py @@ -347,6 +347,9 @@ def is_locked(locked_dir_path: Path, /) -> bool: logger.info(f'Old lock ({lock_ts.isoformat()}) {lock_file}, removing it.') lock_file.unlink(missing_ok=True) return False + except FileNotFoundError: + logger.debug('Lock found and removed by another process.') + return False except Exception as e: logger.critical(f'Lock found, but unable process it: {e}.') return False