Skip to content

Commit

Permalink
refactor: simplify code
Browse files Browse the repository at this point in the history
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
  • Loading branch information
ankush and akhilnarang committed Feb 6, 2024
1 parent d89e0e7 commit 2c19e84
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions frappe/utils/file_lock.py
Expand Up @@ -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):
Expand Down

0 comments on commit 2c19e84

Please sign in to comment.