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

Limit duration in IMAP IDLE mode

parent 23f06e62
...@@ -58,11 +58,9 @@ class Receiver(EmailBootStep): ...@@ -58,11 +58,9 @@ class Receiver(EmailBootStep):
conn.delete_messages(msgid) conn.delete_messages(msgid)'Starting idle')'Starting idle')
conn.idle() conn.idle()
responses = [] for _ in range(60): # Stay in IDLE mode at most 5 min
while self._running and not responses: if not self._running or conn.idle_check(timeout=5):'Checking idle') break
responses = conn.idle_check(timeout=5)'Idle responses: %r', responses)'Idle done')'Idle done')
conn.idle_done() conn.idle_done()
except IMAPClientAbortError: 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