mirror of
https://github.com/vale981/kindle_fetch
synced 2025-03-04 08:31:38 -05:00
do not time out while waiting for mail
This commit is contained in:
parent
f1c8ea7586
commit
4296f6b6c4
1 changed files with 8 additions and 5 deletions
|
@ -149,12 +149,15 @@ async def wait_for_new_message(imap_client, options: Options):
|
|||
)
|
||||
|
||||
while True:
|
||||
logger.debug("waiting for new message")
|
||||
try:
|
||||
logger.debug("waiting for new message")
|
||||
|
||||
idle_task = await imap_client.idle_start(timeout=60)
|
||||
msg = await imap_client.wait_server_push()
|
||||
imap_client.idle_done()
|
||||
await wait_for(idle_task, timeout=5)
|
||||
idle_task = await imap_client.idle_start(timeout=float("inf"))
|
||||
msg = await imap_client.wait_server_push()
|
||||
imap_client.idle_done()
|
||||
await wait_for(idle_task, timeout=float("inf"))
|
||||
except TimeoutError:
|
||||
continue
|
||||
|
||||
for message in msg:
|
||||
if message.endswith(b"EXISTS"):
|
||||
|
|
Loading…
Add table
Reference in a new issue