Keep a trailing AS set out of the origin and the peerings (closes #75)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A path ending in an AS set, such as [64496, 64497, [64498, 64499]], was flattened into the sequence, so the route was stored as originated by the last set member and the peering handler recorded peerings the path does not show. ASPath now keeps the sequence and a trailing set of several members apart; Origin() gives the last AS of the sequence, or 0 (no known origin) for such a set. The handlers use it; peerings come from the sequence only. The pages show origin 0 as no known origin, and the IP lookup asks no WHOIS lookup for it. Empty paths are unchanged. Model: opus-5-5
This commit was merged in pull request #91.
This commit is contained in:
@@ -2141,11 +2141,12 @@ func (d *Database) GetIPInfoContext(
|
||||
info.FirstSeen = prefixFirstSeen.Time
|
||||
}
|
||||
|
||||
// Check if WHOIS data needs refresh (never fetched or older than 30 days)
|
||||
// Check if WHOIS data needs refresh (never fetched or older than 30 days).
|
||||
// A route with origin 0 has no known origin, so no AS to look up.
|
||||
const staleThreshold = 30 * 24 * time.Hour
|
||||
|
||||
info.NeedsWHOISRefresh = !whoisUpdatedAt.Valid ||
|
||||
time.Since(whoisUpdatedAt.Time) > staleThreshold
|
||||
info.NeedsWHOISRefresh = info.ASN != 0 && (!whoisUpdatedAt.Valid ||
|
||||
time.Since(whoisUpdatedAt.Time) > staleThreshold)
|
||||
|
||||
return info, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user