Skip to content

Commit

Permalink
Fixes rescheduling on boltdb store
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Dec 11, 2018
1 parent b0254ac commit ea5e60b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dkron/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ func (a *Agent) RunQuery(ex *Execution) {
func (a *Agent) SchedulerRestart() {
if rescheduleThrotle == nil {
rescheduleThrotle = time.AfterFunc(rescheduleTime, func() {
// In case we are using BoltDB we just need to reschedule because
// there is no leader nor other nodes.
// In case of using any other engine send the scheduler restart query.
if a.config.Backend == store.BOLTDB {
a.schedule()
} else {
a.schedulerRestartQuery(string(a.Store.GetLeader()))
}
})
} else {
rescheduleThrotle.Reset(rescheduleTime)
Expand Down

0 comments on commit ea5e60b

Please sign in to comment.