func makeLayoutRegexp(layout, value string) *regexp.Regexp {
layout = strings.Replace(layout, `%value%`, value, -1)
re := layoutRegexp[layout]
if re == nil {
re = regexp.MustCompile(layout)
layoutRegexp[layout] = re
}
return re
}
This code will panic when multi-goroutine calls cronexp.Parse(xx) concurrently.
This code will panic when multi-goroutine calls cronexp.Parse(xx) concurrently.
call stack:
I will try to workaround this by call cronexp.Parse() when first start(no other goroutine init). :-) and maybe try to send a pull request.