summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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):