Shutdown: do not save peers if we did not become ready
License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
parent
199dbb944a
commit
107ad3bdfc
|
@ -451,8 +451,11 @@ func (c *Cluster) Shutdown() error {
|
|||
}
|
||||
}
|
||||
|
||||
c.peerManager.savePeers()
|
||||
c.backupState()
|
||||
// Do not save anything if we were not ready
|
||||
if c.readyB {
|
||||
c.peerManager.savePeers()
|
||||
c.backupState()
|
||||
}
|
||||
|
||||
if err := c.monitor.Shutdown(); err != nil {
|
||||
logger.Errorf("error stopping monitor: %s", err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user