+1
-1
config.yaml
+1
-1
config.yaml
+3
internal/api/handlers.go
+3
internal/api/handlers.go
+6
-2
internal/storage/postgres.go
+6
-2
internal/storage/postgres.go
···
303
303
argIdx++
304
304
}
305
305
306
-
// NEW: Filter for stale endpoints only
306
+
// FIXED: Filter for stale endpoints only
307
307
if filter.OnlyStale && filter.RecheckInterval > 0 {
308
-
query += fmt.Sprintf(" AND (last_checked IS NULL OR last_checked < NOW() - INTERVAL '%d seconds')", int(filter.RecheckInterval.Seconds()))
308
+
// Calculate cutoff time in UTC (Go side, not PostgreSQL side)
309
+
cutoffTime := time.Now().UTC().Add(-filter.RecheckInterval)
310
+
query += fmt.Sprintf(" AND (last_checked IS NULL OR last_checked < $%d)", argIdx)
311
+
args = append(args, cutoffTime)
312
+
argIdx++
309
313
}
310
314
}
311
315