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
|
return backendsHealthy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (bg *BackendGroup) Shutdown() {
|
||||||
|
if bg.Consensus != nil {
|
||||||
|
bg.Consensus.Shutdown()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func calcBackoff(i int) time.Duration {
|
func calcBackoff(i int) time.Duration {
|
||||||
jitter := float64(rand.Int63n(250))
|
jitter := float64(rand.Int63n(250))
|
||||||
ms := math.Min(math.Pow(2, float64(i))*1000+jitter, 3000)
|
ms := math.Min(math.Pow(2, float64(i))*1000+jitter, 3000)
|
||||||
|
@ -225,9 +225,7 @@ func (s *Server) Shutdown() {
|
|||||||
_ = s.wsServer.Shutdown(context.Background())
|
_ = s.wsServer.Shutdown(context.Background())
|
||||||
}
|
}
|
||||||
for _, bg := range s.BackendGroups {
|
for _, bg := range s.BackendGroups {
|
||||||
if bg.Consensus != nil {
|
bg.Shutdown()
|
||||||
bg.Consensus.Shutdown()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user