Fix ConnectionResetError when only ping task (#24)

This commit is contained in:
omg-xtao 2024-02-11 21:51:47 +08:00 committed by GitHub
parent 83a89e79de
commit d505b2f372
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -285,7 +285,10 @@ class Session:
ping_id=0, disconnect_delay=self.WAIT_TIMEOUT + 10 ping_id=0, disconnect_delay=self.WAIT_TIMEOUT + 10
), False ), False
) )
except (OSError, RPCError): except OSError:
self.loop.create_task(self.restart())
break
except RPCError:
pass pass
log.info("PingTask stopped") log.info("PingTask stopped")