From 655a60ec982f27d4afcfc0d7de926fb82f2ac5b8 Mon Sep 17 00:00:00 2001 From: Akizon77 Date: Sat, 9 Aug 2025 04:24:21 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E6=8A=A5=E4=B8=A2=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/task.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/task.go b/server/task.go index 77c921b..415cb15 100644 --- a/server/task.go +++ b/server/task.go @@ -235,9 +235,11 @@ func NewPingTask(conn *ws.SafeConn, taskID uint, pingType, pingTarget string) { "value": pingResult, "finished_at": time.Now(), } - if pingResult == -1 { - return - } + // https://github.com/komari-monitor/komari/commit/eb87a4fc330b7d1c407fa4ff70177615a4f50a1f + // -1 代表丢包,服务端计算 + //if pingResult == -1 { + // return + //} if err := conn.WriteJSON(payload); err != nil { log.Printf("Failed to write JSON to WebSocket: %v", err) }