chg: Avoid unnecessary critical log.

pull/920/head
Raphaël Vinot 2024-06-04 11:56:58 +02:00
parent 6af21e7533
commit 550c94e049
1 changed files with 3 additions and 0 deletions

View File

@ -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