mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 10:36:37 +00:00
Improve error handling in reconnection logic by logging failures and raising exceptions
This commit is contained in:
parent
4315ddbb57
commit
e90d204287
@ -317,11 +317,11 @@ class Sender:
|
|||||||
if delay is not True:
|
if delay is not True:
|
||||||
await asyncio.sleep(delay)
|
await asyncio.sleep(delay)
|
||||||
continue
|
continue
|
||||||
elif delay is not None:
|
else:
|
||||||
self._logger.info(
|
self._logger.error(
|
||||||
f"waiting {delay} seconds before next reconnection attempt"
|
f"auto-reconnect failed {attempts} time(s); giving up"
|
||||||
)
|
)
|
||||||
await asyncio.sleep(delay)
|
raise
|
||||||
|
|
||||||
def _try_fill_write(self) -> None:
|
def _try_fill_write(self) -> None:
|
||||||
if not self._requests:
|
if not self._requests:
|
||||||
|
Loading…
Reference in New Issue
Block a user