From 6ff6e56db842ca4c8eef4582d5d3e7facac52073 Mon Sep 17 00:00:00 2001 From: Cory Jacobsen Date: Fri, 29 Nov 2024 14:47:28 -0600 Subject: [PATCH] fix(dashboard): cleanup viewcontroller after each request. Fixes #2095 Signed-off-by: Cory Jacobsen --- server/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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