Closed favians closed 4 years ago
First, typically these questions are for Stackoverflow. Second the role of JobRunner is a JIT (just-in-time) cron scheduler. For example, when a request comes to POST /users
you schedule jobs to send emails, to checks or validations etc...
I think what you're looking for is a cron job orchestration something along the lines of crontab
or chronos
or even using the github.com/robfig/cron/v3@v3.0.0
directly without the JobRunner interface in a long polling service.
re:your code > the parts involving JobRunner are ok, however the cron specification for @everyday midnight
would be 0 0 0 ? * * *
Why my jobrunner only run once after the program starting? Im currently set my jobrunner
"@midnight" / "0 0 * * *"
, this jobrunner only run once after program started (or even not running at all), and the next day nothing happend. Any wrong / missing with my code?Here my code:
Expired.go
Main.go
thank you. . .