update client

This commit is contained in:
callebtc
2023-02-08 09:55:49 +01:00
parent 123cfb56ae
commit c4fbeb83d7
3 changed files with 47 additions and 36 deletions

View File

@@ -78,10 +78,8 @@ class Relay:
@property
def ping(self):
if self.connected:
return int((self.ws.last_pong_tm - self.ws.last_ping_tm) * 1000)
else:
return 0
ping_ms = int((self.ws.last_pong_tm - self.ws.last_ping_tm) * 1000)
return ping_ms if self.connected and ping_ms > 0 else 0
def publish(self, message: str):
self.queue.put(message)