I am using PidFileError exception raised while acquiring the lock to check its acquired status. But it interferes with the other attempts to acquire the lock during the check period. Is there a way get the status directly?
def is_locked(filename):
try:
with PidFile(filename):
# Parallel lock acquire attempts fail here
return False
except PidFileError:
return True
I am using
PidFileError
exception raised while acquiring the lock to check its acquired status. But it interferes with the other attempts to acquire the lock during the check period. Is there a way get the status directly?