diff --git a/internal/routewatch/peeringhandler.go b/internal/routewatch/peeringhandler.go index d58d0ff..050cb23 100644 --- a/internal/routewatch/peeringhandler.go +++ b/internal/routewatch/peeringhandler.go @@ -165,7 +165,9 @@ func (h *PeeringHandler) prunePaths() { } } -// ProcessPeeringsNow forces immediate processing of peerings (for testing) +// ProcessPeeringsNow triggers immediate processing of all accumulated AS +// paths into peering records. This bypasses the normal periodic processing +// schedule and is primarily intended for testing purposes. func (h *PeeringHandler) ProcessPeeringsNow() { h.processPeerings() } @@ -246,7 +248,10 @@ func (h *PeeringHandler) processPeerings() { ) } -// Stop gracefully stops the handler and processes remaining peerings +// Stop gracefully shuts down the handler by signaling the background +// goroutines to stop and performing a final synchronous processing of +// any remaining AS paths. This ensures no peering data is lost during +// shutdown. func (h *PeeringHandler) Stop() { close(h.stopCh) // Process any remaining peerings synchronously