fixed init errors

This commit is contained in:
ston1th 2021-03-07 13:48:30 +01:00
commit 7c7b816813
8 changed files with 29 additions and 18 deletions

View file

@ -155,10 +155,10 @@ func (c *Cluster) Start(etcdcfg *config.Config) error {
}
s.Close()
close(c.done)
return nil
return c.fatal
}
}
return nil
return c.fatal
}
func (c *Cluster) leaderID(r *clientv3.GetResponse, err error) string {
@ -197,8 +197,8 @@ func (c *Cluster) Stepdown() {
}
}
func (c *Cluster) Fatal(err error, msg string) {
c.Error(err, "a fatal error occurred", "message", msg)
func (c *Cluster) Fatal(err error) {
c.fatal = err
c.Stop()
}