Skip to content

Open-source status page, incident response and uptime monitoring

fix: use current timestamp for failed TCP connections (#2484)

Max598fcb8b1791
diff --git a/apps/checker/pkg/job/tcp_job.go b/apps/checker/pkg/job/tcp_job.go
index d349e620c..a4891bffd 100644
--- a/apps/checker/pkg/job/tcp_job.go
+++ b/apps/checker/pkg/job/tcp_job.go
@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "time"
"github.com/cenkalti/backoff/v5"
"github.com/google/uuid"
@@ -66,11 +67,14 @@ func (jobRunner) TCPJob(ctx context.Context, monitor *v1.TCPMonitor, region stri
lastResult = checker.TCPResponse{Error: 1}
+ // Use current timestamp since connection failed and res.TCPStart would be 0
+ now := time.Now().UnixMilli()
+
return &TCPPrivateRegionData{
ID: id.String(),
Latency: 0,
- Timestamp: res.TCPStart,
- CronTimestamp: res.TCPStart,
+ Timestamp: now,
+ CronTimestamp: now,
URI: monitor.Uri,
RequestStatus: "error",
Error: 1,