oracle: make double-Shutdown a no-op

This commit is contained in:
Roman Khimov 2022-07-01 23:31:25 +03:00
parent 6b2fc5e056
commit cab633ffed

View file

@ -181,6 +181,12 @@ func (o *Oracle) Name() string {
// Shutdown shutdowns Oracle.
func (o *Oracle) Shutdown() {
o.respMtx.Lock()
defer o.respMtx.Unlock()
if !o.running {
return
}
o.running = false
close(o.close)
o.getBroadcaster().Shutdown()
}