diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 7206050d..e5b53d17 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -285,7 +285,10 @@ class Session: ping_id=0, disconnect_delay=self.WAIT_TIMEOUT + 10 ), False ) - except (OSError, RPCError): + except OSError: + self.loop.create_task(self.restart()) + break + except RPCError: pass log.info("PingTask stopped")