From 0e2712178da8b8574643094c35f597b345774036 Mon Sep 17 00:00:00 2001 From: Michael Freeman Date: Wed, 19 Feb 2025 21:46:45 -0600 Subject: [PATCH] WIP sync --- pkg/agent/server.go | 1 + pkg/agent/snmp_checker.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/agent/server.go b/pkg/agent/server.go index 019315d..e8bd699 100644 --- a/pkg/agent/server.go +++ b/pkg/agent/server.go @@ -222,6 +222,7 @@ func (s *Server) Stop(ctx context.Context) error { } var stopErrors []error + for _, svc := range s.services { if err := s.stopService(ctx, svc); err != nil { stopErrors = append(stopErrors, err) diff --git a/pkg/agent/snmp_checker.go b/pkg/agent/snmp_checker.go index 978676f..a273e86 100644 --- a/pkg/agent/snmp_checker.go +++ b/pkg/agent/snmp_checker.go @@ -80,6 +80,7 @@ func NewSNMPChecker(address string) (checker.Checker, error) { // Start the service with a background context and link it to the done channel ctx, cancel := context.WithCancel(context.Background()) + go func() { // Tie the context cancellation to the done channel select {