fix: 上报丢包

This commit is contained in:
Akizon77
2025-08-09 04:24:21 +00:00
parent 0f85a6ac90
commit 655a60ec98

View File

@@ -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)
}