refactor: simplify code
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
d89e0e7e4c
commit
2c19e846df
1 changed files with 1 additions and 5 deletions
|
|
@ -44,11 +44,7 @@ def lock_exists(name):
|
|||
|
||||
def lock_age(name) -> float:
|
||||
"""Return time in seconds since lock was created."""
|
||||
mtime = Path(get_lock_path(name)).stat().st_mtime
|
||||
if not mtime:
|
||||
return None
|
||||
|
||||
return time() - mtime
|
||||
return time() - Path(get_lock_path(name)).stat().st_mtime
|
||||
|
||||
|
||||
def check_lock(path, timeout=600):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue