Improve error handling in reconnection logic by logging failures and raising exceptions

This commit is contained in:
Jahongir Qurbonov 2025-06-03 09:45:19 +05:00
parent 4315ddbb57
commit e90d204287
No known key found for this signature in database
GPG Key ID: 256976CED13D5F2D

View File

@ -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: