update

Changed files
+10 -3
internal
api
storage
+1 -1
config.yaml
··· 14 14 scan_interval: "30m" 15 15 timeout: "30s" 16 16 workers: 20 17 - recheck_interval: "30m" 17 + recheck_interval: "1.5h" 18 18 scan_retention: 3 19 19 20 20 api:
+3
internal/api/handlers.go
··· 271 271 if pds.IPInfo.ASN > 0 { 272 272 response["asn"] = pds.IPInfo.ASN 273 273 } 274 + if pds.IPInfo.IsDatacenter { 275 + response["is_datacenter"] = pds.IPInfo.IsDatacenter 276 + } 274 277 } 275 278 276 279 return response
+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