diff --git a/scheduler.go b/scheduler.go index 5d026d10..b436a133 100644 --- a/scheduler.go +++ b/scheduler.go @@ -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 }