offlineimap/accounts added Exception with lock file
This patch includes an Exception to catch when two instances of offlineimap are running. Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This commit is contained in:
parent
0b9b09f265
commit
bab7dd00c9
@ -242,6 +242,12 @@ class SyncableAccount(Account):
|
||||
fcntl.lockf(self._lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
except NameError:
|
||||
pass # fnctl not available, disable file locking... :(
|
||||
except IOError:
|
||||
raise OfflineImapError(
|
||||
"Could not lock account %s. Is another "
|
||||
"instance using this account?" % self,
|
||||
OfflineImapError.ERROR.REPO,
|
||||
exc_info()[2])
|
||||
except IOError:
|
||||
self._lockfd.close()
|
||||
raise OfflineImapError(
|
||||
|
Loading…
Reference in New Issue
Block a user