cron
cron copied to clipboard
Support @reboot
Hi, do you have any plan to support non-standard case @reboot
, here I mean trigger a call back when invoke cron.Start() method to run the cron goroutine. This may help user to fire an event (call back) in the cron goroutine. If user wants to run some methods based on the time.Time now in the cron.Cron.Run() method before running schedule timer. This can help. Without it, it is not easier to implement codes want to sync time.Time NOW with the cron goroutine. This may be very critical in some case.
You can simply run your functions before invoking cron.Start() to emulate @reboot
, no?
I would like this library to match https://en.wikipedia.org/wiki/Cron ... and it DOES look like @reboot is mentioned there. I must have missed it, or I didn't draw the connection to running it on Start(), since that's not necessarily on reboot.
Although the workaround exists and is not too onerous, this has come up enough that it's probably worth adding..
Actually.. I'm not sure about this. It seems like the distinction between a real reboot is important to make it much more useful.
The workaround is actually easier than using this schedule 😆
myFunc()
vs
c.AddFunc("@reboot", myFunc)
What am I missing?