fix: remove duplicate wrong error log in socket/fetch handler and dead code in reliablePing

Former-commit-id: d57b7ccb53
This commit is contained in:
immanuwell
2026-05-30 21:55:46 +04:00
parent 2cd9ffc582
commit 763ef3726e
2 changed files with 3 additions and 15 deletions
+3 -11
View File
@@ -121,19 +121,11 @@ func reliablePing(tnet *netstack.Net, dst string, baseTimeout time.Duration, max
totalLatency += latency
successCount++
// If we get at least one success, we can return early for health checks
if successCount > 0 {
avgLatency := totalLatency / time.Duration(successCount)
// logger.Debug("Reliable ping succeeded after %d attempts, avg latency: %v", attempt, avgLatency)
return avgLatency, nil
}
// Return on first success
return totalLatency / time.Duration(successCount), nil
}
if successCount == 0 {
return 0, fmt.Errorf("all %d ping attempts failed, last error: %v", maxAttempts, lastErr)
}
return totalLatency / time.Duration(successCount), nil
return 0, fmt.Errorf("all %d ping attempts failed, last error: %v", maxAttempts, lastErr)
}
func pingWithRetry(tnet *netstack.Net, dst string, timeout time.Duration) (stopChan chan struct{}, err error) {