diff --git a/proxyd/proxyd/backend.go b/proxyd/proxyd/backend.go index 4e8fd70..fea2138 100644 --- a/proxyd/proxyd/backend.go +++ b/proxyd/proxyd/backend.go @@ -706,6 +706,12 @@ func (b *BackendGroup) loadBalancedConsensusGroup() []*Backend { return backendsHealthy } +func (bg *BackendGroup) Shutdown() { + if bg.Consensus != nil { + bg.Consensus.Shutdown() + } +} + func calcBackoff(i int) time.Duration { jitter := float64(rand.Int63n(250)) ms := math.Min(math.Pow(2, float64(i))*1000+jitter, 3000) diff --git a/proxyd/proxyd/server.go b/proxyd/proxyd/server.go index 794d4f8..d813bed 100644 --- a/proxyd/proxyd/server.go +++ b/proxyd/proxyd/server.go @@ -225,9 +225,7 @@ func (s *Server) Shutdown() { _ = s.wsServer.Shutdown(context.Background()) } for _, bg := range s.BackendGroups { - if bg.Consensus != nil { - bg.Consensus.Shutdown() - } + bg.Shutdown() } }