forked from TrueCloudLab/neoneo-go
rpc/server: make double Shutdown a no-op
This commit is contained in:
parent
527505ea5e
commit
c096f32a32
1 changed files with 2 additions and 2 deletions
|
@ -260,9 +260,9 @@ func (s *Server) Start() {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown stops the RPC server. It can only be called once.
|
// Shutdown stops the RPC server if it's running.
|
||||||
func (s *Server) Shutdown() {
|
func (s *Server) Shutdown() {
|
||||||
if !s.started.Load() {
|
if !s.started.CAS(true, false) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Signal to websocket writer routines and handleSubEvents.
|
// Signal to websocket writer routines and handleSubEvents.
|
||||||
|
|
Loading…
Reference in a new issue