Fix ConnectionResetError when only ping task

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
omg-xtao 2024-02-11 21:51:47 +08:00 committed by wulan17
parent 92e4ca845b
commit 3f34c96175
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -287,7 +287,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")