-
Notifications
You must be signed in to change notification settings - Fork 1.7k
two cron expression all run on 2017-10-18, i think it's a bug 8000 #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's not a bug,
Why see below code parse.go files func getRange(expr string, r bounds) (uint64, error) {
var (
start, end, step uint
rangeAndStep = strings.Split(expr, "/")
lowAndHigh = strings.Split(rangeAndStep[0], "-")
singleDigit = len(lowAndHigh) == 1
err error
)
var extra uint64
if lowAndHigh[0] == "*" || lowAndHigh[0] == "?" {
start = r.min
end = r.max
extra = starBit when day-of-week or day-of-month any one is "*" or "?" lead to func dayMatches(s *SpecSchedule, t time.Time) bool {
var (
domMatch bool = 1<<uint(t.Day())&s.Dom > 0
dowMatch bool = 1<<uint(t.Weekday())&s.Dow > 0
)
if s.Dom&starBit > 0 || s.Dow&starBit > 0 {
return domMatch && dowMatch
}
return domMatch || dowMatch
}
|
hqy, thank you for quickly answer. |
You are correct, sorry for the long silence. This is a dupe of issue #70 |
Uh oh!
There was an error while loading. Please reload this page.
two cron expression all run on 2017-10-18, i think it's a bug
[/10 * * 1-29 10 1-5],[/10 * * 30,31 10 1-5]
test code:
cronTask.AddFunc("/10 * * 1-29 10 1-5", func() {
fmt.Println("run:" + "/10 * * 1-29 10 1-5")
})
cronTask.AddFunc("/10 * * 30,31 10 1-5", func() {
fmt.Println("run:" + "/10 * * 30,31 10 1-5")
})
the code in spec.go line149
func dayMatches return true on domMatch || dowMatch, but, this expression "*/10 * * 30,31 10 1-5" should return false.
The text was updated successfully, but these errors were encountered: