Skip to content

Commit

Permalink
Merge pull request #3 from davleb/master
Browse files Browse the repository at this point in the history
Update gocron to fix non running jobs with weeks or days units
  • Loading branch information
marcsantiago authored Oct 10, 2018
2 parents c8aa208 + b8eb1ca commit 54db357
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gocron.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@ func (j *Job) scheduleNextRun() error {

switch j.unit {
case days:
j.shouldDo = true
j.mu.Lock()
j.nextRun = j.roundToMidnight(j.lastRun)
j.nextRun = j.nextRun.Add(j.atTime)
j.mu.Unlock()
case weeks:
j.shouldDo = true
j.mu.Lock()
j.nextRun = j.roundToMidnight(j.lastRun)
dayDiff := int(j.startDay)
Expand Down

0 comments on commit 54db357

Please sign in to comment.