-
Notifications
You must be signed in to change notification settings - Fork 8
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
feature: cron implementation #1194
Conversation
# Conflicts: # buildengine/testdata/projects/another/go.sum # go-runtime/compile/testdata/one/go.sum # go-runtime/compile/testdata/two/go.sum # Conflicts: # backend/controller/cronjobs/cronjobs.go # backend/schema/metadatacronjob.go # backend/schema/validate.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
components[6] = newComponentWithFullRange() | ||
return components, nil | ||
case 6: | ||
// Might be two different formats unfortunately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these semantics the same as other implementations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a neat single place that defines it well, but this part of wikipedia helps show its a bit of a wild west https://en.wikipedia.org/wiki/Cron#Cron_expression
Note the year being optional (and not in standard versions) and that "In some uses of the cron format there is also a seconds field at the beginning of the pattern. In that case, the cron expression is a string comprising 6 or 7 fields."
I looked into how gronx handled this and they look for a 4 digit number to determine if it is a year, which is what I've done here as well.
https://github.com/adhocore/gronx/blob/d84c38971549dda6eb2803d83756e340fd40c297/gronx.go#L105
- [x] Schema changes - [x] Module validation - [x] Support multiple controllers using hash ring - [x] DB indexes - [x] Tests - [x] CronJobs Service - [x] cron lib - [x] schema changes Separating into different PRs: - [x] cron implementation: #1194 - [x] deepcopy: #1195 - [x] metadata changes #1216 - [x] db level changes: #1229 - [ ] Afterwards: ftl-examples - [ ] Afterwards: add event for it to show in web console #1141
Built a cron implementation which will be used as part of our cron jobs feature (See: #1155)
Splitting this off into this smaller PR to make things easier.