Skip to content

Commit

Permalink
Fix scheduling for week N
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTetrahedron committed Jun 28, 2024
1 parent cd1f219 commit eeea4dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ func (w MergeWindow) checkIsoWeek(t time.Time) (bool, error) {
return iw%2 == 0, nil
case "@odd":
return iw%2 == 1, nil
case strconv.Itoa(iw):
return true, nil
default:
return false, fmt.Errorf("unknown iso week: %s", w.Schedule.IsoWeek)
}
nw, err := strconv.ParseInt(w.Schedule.IsoWeek, 10, 64)
if err == nil {
return nw == int64(iw), nil
}

return false, fmt.Errorf("unknown iso week: %s", w.Schedule.IsoWeek)
}

0 comments on commit eeea4dd

Please sign in to comment.