update _on_disconnect method in TelegramClient: change to async for better handling of disconnections

This commit is contained in:
vvzvlad
2025-06-10 03:25:54 +03:00
parent 95361be6f4
commit c94090c4b5
+1 -1
View File
@@ -49,7 +49,7 @@ class TelegramClient:
self.client.add_handler(DisconnectHandler(self._on_disconnect))
logger.info("connection_handlers: connection handlers set up")
def _on_disconnect(self, _client):
async def _on_disconnect(self, _client):
"""Handles disconnection from Telegram servers"""
self.disconnect_count += 1
logger.warning(f"connection_handler: connection lost (#{self.disconnect_count})")