I tried to take the value of your example as parameter for every :
agenda.every('*/3 * * * *', 'delete old users');
But it's not working : "failed to calculate nextRunAt due to invalid repeat interval"
@simison should this work? We don't have any tests at all showing cron values being usable in every.
It's listed here at least:
https://github.com/agenda/agenda#example-usage
There are some other inconsistencies around cron/human readable times as well: https://github.com/rschmukler/human-interval/issues/5
Shall we create a timeDateHandler that we can just pass and it can workout the correct one to use? That'd allow all methods to use the same function.
I was just about to suggest same.
Invalid times passed to schedule() on the other hand seem to be failing silently.
I have encountered issues as well and ended up using moment's duration:
job.schedule(moment().add({minutes: 30}).toDate());
Is this problem solved? I am facing the same problem using cron expression, and it still present in the DOCs.
I'm trying to use 0,20,40 * * ? * * *, but I got this error:
failed to calculate nextRunAt due to invalid repeat interval
Same here, it doesn't support values separated by comma correctly. I also tried with months and days
@simison @OmgImAlexis just ran into this 1.5 years after the OP. is there any priority for getting this resolved? Not being able to use valid cron strings is whooping us pretty good in our implementation.
@edwin-jones as a recent contributor, are you in a position to put eyes on this?
@shellscape any help get it fixed would be much appreciated.
I Had similar issue when i tried installing by 'npm install agenda'. I found in node_modules that corn was not installed by default. So when I used 'npm install agenda --save' it installs all the required dependencies and it worked like charm.
@R-Rudolfhertz Thanks, that fixes the issue for us. kind of, we have to install cron dependency ourself to fix the issue. npm i cron --save...
That's really weird, because cron is explicitly specified in the package.json of agenda..
I installed the cron-package but cron values still don't work with every.
scheduling repeat jobs is I think a core feature.
Is there a PR open for this already or is there a way I can help with this?
this issue is around for a while, are you guys using a workaround?
@leonardlin all the help welcome! Fixing/defining expected behavior (even if only by writing tests) in Agenda, as well as looking up existing PRs and helping to test+review those.
for documentation there is a PR in this are: https://github.com/agenda/agenda/pull/475
@simison with 60 open pull requests it doesn't look like help is at all welcome. It looks like maintainers are actively avoiding contributions. If you're going to ask for help, at least clean your house first.
@simison
PR #475 is probably stale by now. It is also based on a very old code base.
I have created a new PR based on https://github.com/agenda/agenda/pull/475 changes.
Please review: https://github.com/agenda/agenda/pull/1150
It includes 2 tests
@shellscape Yeah, I'm specifically asking help with reviews and maintenance.
At least clean your house first.
Me and everyone else here are a folks who passed by and stepped up to help to sort things out. In no way different from you. ;-) Don't complain, even if you have reason to, instead step up and act! ;-) Hope to see you on Slack and PRs!
@shellscape as a very practical next step; would you have headspace to help test & review PR that @leonardlin kindly put together?
I'm no longer an agenda user unfortunately. You can choose to see my prior reply as a complaint, or a call to action. Just as when I took over maintenance of webpack-manifest-plugin, my first order of business was the "clean the house" by addressing open PRs, stale issues, etc. I couldn't reasonably ask others for contributions and assistance until existing ones were resolved in some way, shape, or form. That allowed me and others to then effect the codebase in a positive way, and now the project is healthy. Take that for what you will.
@shellscape sure, that's a fair perspective. Believe me, everyone who joins has done their share of exactly that. I think what I hear you say is that it would be better to stop accepting any contributions otherwise? That seems like a bummer, too. :-) Especially if you consider that most of the progress in Agenda in past years is coming from small single-time contributors.
@shellscape @simison
I have to head out but will address the PR comments and reupload again.
After that I would be interested to help with the PR testing and rewiews.
There are lot of maintenance PRs that are low risk and I can work from top to down.
Most PRs can't be merged anymore because they are really old. I see if I can clean them up / make them up to date.
Will ping you guys later again about it.
Let me know what the procedure is to become a contributor with write access.
Best
Let me know what the procedure is to become a contributor with write access.
Fantastic! Please do join the Slack if you haven't already. :-) Just drop me an email (visible at my profile) and I'll invite you. There should be a link to join at Readme too but looks like it's a bit broken...
https://github.com/agenda/agenda/pull/1150 is merged,