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:
parent
2b7baaf294
commit
4fb833176e
1 changed files with 1 additions and 1 deletions
|
@ -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."""
|
||||
|
|
Loading…
Reference in a new issue