consensus: make double-call to Shutdown a no-op
This commit is contained in:
parent
2f55070a57
commit
cd4f46247d
1 changed files with 1 additions and 1 deletions
|
@ -274,7 +274,7 @@ func (s *service) Start() {
|
||||||
|
|
||||||
// Shutdown implements the Service interface.
|
// Shutdown implements the Service interface.
|
||||||
func (s *service) Shutdown() {
|
func (s *service) Shutdown() {
|
||||||
if s.started.Load() {
|
if s.started.CAS(true, false) {
|
||||||
close(s.quit)
|
close(s.quit)
|
||||||
<-s.finished
|
<-s.finished
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue