move consensus shutdown nested inside the backend group
This commit is contained in:
parent
806ad4c5b1
commit
4c08681043
@ -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)
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user