Skip to content

Commit

Permalink
Fix ConnectionResetError when only ping task
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
omg-xtao authored and wulan17 committed Mar 23, 2024
1 parent 92e4ca8 commit 3f34c96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyrogram/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ async def ping_worker(self):
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")
Expand Down

0 comments on commit 3f34c96

Please sign in to comment.