1
0
Fork 0
mirror of https://git.code.sf.net/p/archivemail/code synced 2025-01-02 21:24:40 +00:00

When creating a dotlock, register it slightly earlier for cleanup

This closes a very unlikely window where we could create a dotlock file, but
then encounter an error and fail to clean up the dotlock.
This commit is contained in:
Nikolaus Schulz 2010-01-15 23:03:32 +01:00
parent 2b7baaf294
commit 4fb833176e

View file

@ -398,11 +398,11 @@ class LockableMboxMixin:
raise LockUnavailable("Dotlock for '%s' unavailable" % self.mbox_file_name)
else:
raise
_stale.dotlock_files.append(lock_name)
finally:
os.close(plfd)
os.unlink(prelock_name)
vprint("acquired lockfile '%s'" % lock_name)
_stale.dotlock_files.append(lock_name)
def _dotlock_unlock(self):
"""Delete the dotlock file for the 'mbox' mailbox."""