mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 04:48:06 +00:00
Wait a little bit before retrying
This commit is contained in:
parent
552474a0e2
commit
9dc767b88e
@ -19,6 +19,7 @@
|
||||
import logging
|
||||
import platform
|
||||
import threading
|
||||
import time
|
||||
from datetime import timedelta, datetime
|
||||
from hashlib import sha1, sha256
|
||||
from io import BytesIO
|
||||
@ -314,7 +315,7 @@ class Session:
|
||||
self._send(functions.PingDelayDisconnect(
|
||||
0, self.WAIT_TIMEOUT + 10
|
||||
), False)
|
||||
except (OSError, TimeoutError):
|
||||
except (OSError, TimeoutError, Error):
|
||||
pass
|
||||
|
||||
log.debug("PingThread stopped")
|
||||
@ -408,6 +409,7 @@ class Session:
|
||||
(log.warning if i > 2 else log.info)(
|
||||
"{}: {} Retrying {}".format(i, datetime.now(), type(data))
|
||||
)
|
||||
time.sleep(1)
|
||||
continue
|
||||
else:
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user