Skip to content

Commit

Permalink
Wait for scheduler stop first (#1016)
Browse files Browse the repository at this point in the history
Before shuting down raft and  store subsystem
  • Loading branch information
Victor Castell authored Sep 16, 2021
1 parent 9bce6e3 commit f604ef8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,16 @@ func (a *Agent) JoinLAN(addrs []string) (int, error) {
func (a *Agent) Stop() error {
a.logger.Info("agent: Called member stop, now stopping")

if a.config.Server {
a.raft.Shutdown()
a.Store.Shutdown()
}

if a.config.Server && a.sched.Started() {
a.sched.Stop()
a.sched.ClearCron()
}

if a.config.Server {
a.raft.Shutdown()
a.Store.Shutdown()
}

if err := a.serf.Leave(); err != nil {
return err
}
Expand Down

0 comments on commit f604ef8

Please sign in to comment.