mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-20 02:45:24 +00:00
Reduce IMAP IDLE refresh rate to 5 minutes
G-Suite is resetting connections after 10 minutes
This commit is contained in:
@@ -1438,9 +1438,9 @@ def watch_inbox(host, username, password, callback, reports_folder="INBOX",
|
||||
|
||||
while True:
|
||||
try:
|
||||
# Refresh the IDLE session every 10 minutes to stay connected
|
||||
if time.monotonic() - idle_start_time > 10 * 60:
|
||||
logger.info("IMAP: Refreshing IDLE session")
|
||||
# Refresh the IDLE session every 5 minutes to stay connected
|
||||
if time.monotonic() - idle_start_time > 5 * 60:
|
||||
logger.debug("IMAP: Refreshing IDLE session")
|
||||
server.idle_done()
|
||||
server.idle()
|
||||
idle_start_time = time.monotonic()
|
||||
|
||||
Reference in New Issue
Block a user