folder.IMAP: Make use of the new connection discarding
In getmessage() we were releaseing a connection when we detected a dropped connection, but it turns out that this was not enough, we need to explicitely discard it when we detect a dropped one. So add the drop_conn=True parameter that was recently introduced to force the discarding of the dead conection. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
fe4f385e2c
commit
7941ea7e7d
@ -99,7 +99,7 @@ class IMAPFolder(BaseFolder):
|
||||
True)
|
||||
except OfflineImapError, e:
|
||||
# retry on dropped connections, raise otherwise
|
||||
self.imapserver.releaseconnection(imapobj, true)
|
||||
self.imapserver.releaseconnection(imapobj, True)
|
||||
if e.severity == OfflineImapError.ERROR.FOLDER_RETRY:
|
||||
retry = True
|
||||
else: raise
|
||||
@ -221,7 +221,7 @@ class IMAPFolder(BaseFolder):
|
||||
fails_left = 0
|
||||
except imapobj.abort(), e:
|
||||
# Release dropped connection, and get a new one
|
||||
self.imapserver.releaseconnection(imapobj)
|
||||
self.imapserver.releaseconnection(imapobj, True)
|
||||
imapobj = self.imapserver.acquireconnection()
|
||||
self.ui.error(e, exc_info()[2])
|
||||
fails_left -= 1
|
||||
|
Loading…
Reference in New Issue
Block a user