From 23dcdd800bfad563a2f3f3052df1c067a5ae1e1a Mon Sep 17 00:00:00 2001 From: sneak Date: Sat, 27 Dec 2025 12:26:07 +0700 Subject: [PATCH] Improve godoc documentation for PeeringHandler Enhance documentation comments for constants, types, and exported methods in peeringhandler.go to follow Go documentation conventions. The improved comments provide more context about the purpose and behavior of each item. --- internal/routewatch/peeringhandler.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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