consensus: make double-call to Shutdown a no-op

This commit is contained in:
Roman Khimov 2022-07-01 21:49:40 +03:00
parent 2f55070a57
commit cd4f46247d

View file

@ -274,7 +274,7 @@ func (s *service) Start() {
// Shutdown implements the Service interface.
func (s *service) Shutdown() {
if s.started.Load() {
if s.started.CAS(true, false) {
close(s.quit)
<-s.finished
}