Replies: 1 comment
-
Sorry about the long wait, it's almost here! Let me know what you think |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I'm finally at a place where I'm happy with the cron parser & scheduler, which means it will be getting published sometime within the next week or two. I added some logging to the cron and & repeat task modules to see which tasks & cron jobs were registered on startup.
What do you guys think of the format?
On a side note, here are a couple of different ways you can use the new cron scheduling feature taken from the demo project file: https://github.com/ndortega/Oxygen.jl/blob/feature/cron-expressions/demo/crondemo.jl
Examples
When making the cron module, I used the spring docs as a guide and made sure that my implementation matched their design description.
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/support/CronExpression.html
How the cron format works
There are six fields that can go into a cron expression in oxygen. Generally, most cron schedulers don't support seconds, but I felt it could be useful and decided to add it in.
seconds
,minutes
,hours
,day of month
,month
,day of week
All trailing fields are optional, which you can see below where I only pass in the
seconds
expression. So if you only need to set the first 2 fields, then you can leave out the rest of the fields and Oxygen will assume you passed an "*" character that matches anything.Using the
@cron
macro directly on a custom functionPase the expression directly to a router
Endpoints can inherit cron expressions & override them just like the other properties in the router
Beta Was this translation helpful? Give feedback.
All reactions