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

@ -160,10 +160,10 @@ func (c *Cluster) Start(raftcfg *config.Config) error {
c.callbacks.Cleanup(ctx, c)
}
close(c.done)
return nil
return c.fatal
}
}
return nil
return c.fatal
}
func (c *Cluster) leader(ctx context.Context) {
@ -187,8 +187,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()
}