From 50dfc5188f268c2eb66b58e2e62a229c2365167a Mon Sep 17 00:00:00 2001 From: Nova Cat Date: Mon, 9 Dec 2024 16:47:46 -0800 Subject: [PATCH] ping --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index ef4bf69..e36c19f 100644 --- a/server.py +++ b/server.py @@ -38,8 +38,8 @@ def pinger(nick, connection): if (time.time() - property_list[nick]["last_ping"]) > 60 and not property_list[nick]["ping_pending"]: print("Sent ping message to " + nick) connection.sendall(bytes(f"PING {server}\r\n","UTF-8")) - ping_pending = True - elif ping_pending and ((time.time() - property_list[nick]["last_ping"]) > 120): + property_list[nick]["ping_pending"] = True + elif property_list[nick]["ping_pending"] and ((time.time() - property_list[nick]["last_ping"]) > 120): property_list[nick]["cause"] = "Ping timeout: 120 seconds" connection.close() break