Skip to content

Commit

Permalink
Update scheduler.go
Browse files Browse the repository at this point in the history
Co-authored-by: streppel <[email protected]>
  • Loading branch information
JohnRoesler and Streppel authored Apr 13, 2021
1 parent 6904911 commit e094dd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (s *Scheduler) calculateDays(job *Job, lastRun time.Time) time.Duration {
lastRunDayPlusJobAtTime := time.Date(lastRun.Year(), lastRun.Month(), lastRun.Day(), 0, 0, 0, 0, s.Location()).Add(job.getAtTime())

// handle occasional occurrence of job running to quickly / too early such that last run was within a second of now
lastRunUnix, nowUnix := job.LastRun().Unix(), s.time.Now(s.location).Unix()
lastRunUnix, nowUnix := job.LastRun().Unix(), s.now().Unix()
if lastRunUnix == nowUnix || lastRunUnix == nowUnix-1 || lastRunUnix == nowUnix+1 {
lastRun = lastRunDayPlusJobAtTime
}
Expand Down

0 comments on commit e094dd9

Please sign in to comment.