summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-05-26 18:00:36 +0200
committerThomas Bruederli <bruederli@kolabsys.com>2015-05-26 18:00:36 +0200
commite5925a3a56502be3e51571ea7db098d29638dfd3 (patch)
tree68d3ef09bd71ff1e9c41bd77a992a0b207657ebc
parenta1a7c5fdb86c513b43deb2496f0d1c604ec52f14 (diff)
downloadpykolab-e5925a3a56502be3e51571ea7db098d29638dfd3.tar.gz
Fix lock check after changed in rP929e67a6
-rw-r--r--wallace/module_invitationpolicy.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index f401b0d..97ff2a3 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -946,16 +946,14 @@ def set_write_lock(key, wait=True):
if os.path.isfile(filename):
locktime = os.path.getmtime(filename)
- locktime = locktime + 300
-
# wait if file lock is in place
- while time.time() < locktime:
+ while time.time() < locktime + 300:
if not wait:
return False
log.debug(_("%r is locked, waiting...") % (key), level=9)
time.sleep(0.5)
- locked = os.path.getmtime(filename) if os.path.isfile(filename) else 0
+ locktime = os.path.getmtime(filename) if os.path.isfile(filename) else 0
# touch the file
if os.path.isfile(filename):