Closed jmettraux closed 5 years ago
Eventutally generalize the
/n+m
concept to the already existing/n
systems.
Days (Monday, Tuesday, Wednesday, ...) are not numbers like days (1..31) or hours (0..24). That generalization is not possible.
Rather "0 0 * * tue%2"
or "0 0 * * tue%2+1"
0 22 * * Tue%2
is nice, but when is the "not other Tuesday"? What is the point of reference? "Oh it's the next Tuesday from the start of the schedule", OK, but the scheduler might restart that reference point will change.
We could use the "last_time" in the job, might work, but that implies passing some context to the #match?
method of the Fugit::Cron
.
Use the next_time(start_time)
's start_time
. When it's a Tuesday, it's the other Tuesday else it's next Tuesday.
Is there a workaround for this currently available?
Hello @thisismydesign,
this issue is about extending the cron syntax supported by fugit.
For when do you need that? In what context are you using fugit?
Hey @jmettraux,
My use case is bi-weekly dynamic scheduling with resque-scheduler
.
resque-scheduler
uses rufus-scheduler
, which uses fugit
if my understanding is correct. Got here by the issue you referenced above: https://github.com/jmettraux/rufus-scheduler/issues/259
Our timeframe for this is pretty short but I'd be happy to come back and use this feature when available.
@thisismydesign,
you can easily implement it by yourself in your Resque-Scheduler job implementation, skip the job if its last trigger time was less than 13 days ago.
I'll try to work on the fugit feature itself tomorrow, I've got an idea on how to make it tick.
Thanks. Yep, that's the workaround in mind. I think the version dependencies are open-ended so theoretically, I could use this as soon as you can release. Do you foresee any other changes that would need to be done for the other gems? (not sure how involved you are with resque-scheduler
)
I am not involved with Resque-Scheduler. Rufus-scheduler should be OK. I guess Resque-Scheduler delegates its cron parsing and validating to rufus-scheduler / fugit entirely. It should pass through once an updated fugit is available.
Hello,
I made good progress on that today, but on its et-orbi side. I'm fighting timezone tests on Windows.
I will continue tomorrow. Hopefully I can implement the proper fugit part of the solution.
Good morning @thisismydesign, if you could have a look at the implementation, that'd be much appreciated.
Thank you @jmettraux, looking at the syntax it makes sense and would be great for us.
OK, I will then release tonight or tomorrow.
Thanks a lot.
Thank you!
It's in today's fugit 1.1.10 release.
Seen first on https://github.com/jmettraux/rufus-scheduler/issues/259
Eventutally generalize the
/n+m
concept to the already existing/n
systems.