Skip to content

Commit d505b2f

Browse files
authored
Fix ConnectionResetError when only ping task (hydrogram#24)
1 parent 83a89e7 commit d505b2f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pyrogram/session/session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ async def ping_worker(self):
285285
ping_id=0, disconnect_delay=self.WAIT_TIMEOUT + 10
286286
), False
287287
)
288-
except (OSError, RPCError):
288+
except OSError:
289+
self.loop.create_task(self.restart())
290+
break
291+
except RPCError:
289292
pass
290293

291294
log.info("PingTask stopped")

0 commit comments

Comments
 (0)