In case of timeout or exception, wait "check_timeout" before to try a new connexion (documentation : "or the number of seconds until the next mail check"). (#377)

Else in case of a mail server issue, we try to connect again each 5 seconds.
This commit is contained in:
Anael Mobilia
2022-12-24 00:23:01 +01:00
committed by GitHub
parent fcc64ed85a
commit 70ff13bfae
+2 -2
View File
@@ -69,8 +69,8 @@ class IMAPConnection(MailboxConnection):
idle_timeout=check_timeout)
except (timeout, IMAPClientError):
logger.warning("IMAP connection timeout. Reconnecting...")
sleep(5)
sleep(check_timeout)
except Exception as e:
logger.warning("IMAP connection error. {0}. "
"Reconnecting...".format(e))
sleep(5)
sleep(check_timeout)