-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic creation of scheduled tasks #2
Comments
Hey, yeah that's correct. @Salakar will take a look at this, should be able to get something in today so manage them in realtime. Cheers |
That would be amazing! Looking forward to it. 👍 |
@reflog yep I'll look at this today, was initially gonna move this kibda dynamic schedule functionality into jobs (delayed jobs), but guess it makes more sense here. |
Excellent. In any case - this project is amazing, if I'm not mistaken, it's the first and only open source task scheduler that supports multi-server setup. Pretty impressive feat! |
@reflog I got quite far with this today, it required a re-write as the current setup required predefining schedules on boot and relying on node to handle timers - so it's taking longer than I thought because this logic is now up to redis to handle but here's what I've got working so far:
Lowest precision supported is 1 second. @Ehesp @reflog can you think of anything else that might be good to have? Little rundown of the approach I'm taking if interested:
Think the logic is valid hah =] |
This most definitely covers all my usage scenarios! 💯 |
Greetings, I would like to help with this issue |
@reflog Another update just to let you know I am still working on this ;p Schedules can now also define a 'starts' and 'ends' or the number of 'times' its should run. Example: const schedule = {
name: 'My Schedule',
runs: 'path.to.global.function',
interval: 'at 5:00 pm every 2 days', // required - human interval string or cron string
starts: 'on sunday', // optional - string, timestamp or date
ends: 'in 28 days', //optional - string, timestamp or date
data: {
foo: 'bar',
},
}; Above example internally outputs as below: Progress can be tracked on the 'next' branch: https://github.com/redibox/schedule/commits/next |
Pretty much there now with it, gonna work on tests now before releasing. Can see progress on the 'next' branch: https://github.com/redibox/schedule/commits/next - still cleaning up shop though =] |
@reflog v2 alpha code pushed to master, 93% test coverage, still need to work on the docs and some more public api methods. Feel free to give it a whirl - the tests in schedule.spec demonstrate how things are created. Schedules provided in the options are default schedules, these persist - even if you flush redis they'll re-appear (added some flush detection logic), only way to get rid of them is a code change. Schedules that are created dynamically using Alpha supports starting at, ending at, X number of times and interval/cron - can mix and match. |
want to schedule some dynamic jobs like mail campaigns as a drip campaign... please suggest me the best options for node |
currently i am using agenda library of node but i am unable to find the proper solution for this |
@jitesh121 have you looked at https://github.com/OptimalBits/bull |
yes i looked but ...don't know to do time based scheduling in it |
I'm working on nodej + typescript application what do you think about this piece of code ? for (let i = 1; i <= 5; i++) {
} here is the result : [Node] Starting cron value of : 1 * * * * * [Node] catched : 1 * * * * * |
Hi.
Maybe I'm missing something - but from the README it appears that all scheduled tasks have to be predefined, is that correct? I cannot add/remove tasks at runtime?
The text was updated successfully, but these errors were encountered: