diff --git a/server/server.go b/server/server.go index 3482634491..9a3e65e328 100644 --- a/server/server.go +++ b/server/server.go @@ -179,7 +179,10 @@ func (s *ArgoRolloutsServer) initRolloutViewController(namespace string, name st } func (s *ArgoRolloutsServer) getRolloutInfo(namespace string, name string) (*rollout.RolloutInfo, error) { - controller := s.initRolloutViewController(namespace, name, context.Background()) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + controller := s.initRolloutViewController(namespace, name, ctx) ri, err := controller.GetRolloutInfo() if err != nil { return nil, err