You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks in advance of my request for a really useful scheduling library.
Is there any scope to extend cron so that the time it has been scheduled for is passed to the job?
Ie so the Job definition becomes something like:
data Job = Job CronSchedule (UTCTime -> IO ())
This way, systems relying on cron can be tested independently of the current wall clock time...
I realise this would break plenty of code, but maybe there is a way to add it without doing so?
I'll take a look at this. It would be a shame if we had to break the constructor to enable this functionality. I'm not that familiar with the Job functionality, someone else added it.
Thanks in advance of my request for a really useful scheduling library.
Is there any scope to extend cron so that the time it has been scheduled for is passed to the job?
Ie so the Job definition becomes something like:
data Job = Job CronSchedule (UTCTime -> IO ())
This way, systems relying on cron can be tested independently of the current wall clock time...
I realise this would break plenty of code, but maybe there is a way to add it without doing so?
Maybe something like:
data Job = Job CronSchedule (IO ())
| JobWithTime CronSchedule (UTCTime -> IO ())
I'm using a fork at https://github.com/joehealy/cron/tree/pass_time_to_jobs to achieve this, but without the backwards compatibility.
The text was updated successfully, but these errors were encountered: