Commit 1e715a9c authored by Leo Pound Singer's avatar Leo Pound Singer

Limit duration in IMAP IDLE mode

parent 23f06e62
......@@ -58,11 +58,9 @@ class Receiver(EmailBootStep):
conn.delete_messages(msgid)
log.info('Starting idle')
conn.idle()
responses = []
while self._running and not responses:
log.info('Checking idle')
responses = conn.idle_check(timeout=5)
log.info('Idle responses: %r', responses)
for _ in range(60): # Stay in IDLE mode at most 5 min
if not self._running or conn.idle_check(timeout=5):
break
log.info('Idle done')
conn.idle_done()
except IMAPClientAbortError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment