Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acquired time #8

Open
jonathansp opened this issue Dec 16, 2013 · 1 comment
Open

Acquired time #8

jonathansp opened this issue Dec 16, 2013 · 1 comment

Comments

@jonathansp
Copy link

Hello,

Is possible to add a method that returns a time/datetime of lock was acquired? I want to test:

if lock.lock_at - now > 5, break_it()

Thank you

@tantale
Copy link

tantale commented Dec 9, 2014

Hollo jonathansp,

I think that:

with lockfile.LockFile(path) as lock:
    lock_time = os.path.getatime(lock.lock_file)

will do the job right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants