mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Wait a little bit before retrying
This commit is contained in:
parent
552474a0e2
commit
9dc767b88e
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Reference in a new issue