mirror of
https://github.com/vale981/kindle_fetch
synced 2025-03-05 09:01:39 -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:
|
while True:
|
||||||
|
try:
|
||||||
logger.debug("waiting for new message")
|
logger.debug("waiting for new message")
|
||||||
|
|
||||||
idle_task = await imap_client.idle_start(timeout=60)
|
idle_task = await imap_client.idle_start(timeout=float("inf"))
|
||||||
msg = await imap_client.wait_server_push()
|
msg = await imap_client.wait_server_push()
|
||||||
imap_client.idle_done()
|
imap_client.idle_done()
|
||||||
await wait_for(idle_task, timeout=5)
|
await wait_for(idle_task, timeout=float("inf"))
|
||||||
|
except TimeoutError:
|
||||||
|
continue
|
||||||
|
|
||||||
for message in msg:
|
for message in msg:
|
||||||
if message.endswith(b"EXISTS"):
|
if message.endswith(b"EXISTS"):
|
||||||
|
|
Loading…
Add table
Reference in a new issue