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
I'm wondering when every will execute a job when defined with a time period instead of cron. In the README there is this example
await agenda.every("3 minutes", "delete old users");
// Alternatively, you could also do:
await agenda.every("*/3 * * * *", "delete old users");
This confuses me, are these the same? The first example could be read run every 3 minutes, while the second example could be read as run at every 3rd minute.
The reason I'm asking is for example I want a job to be run every month:
await agenda.every("1 month", "delete old users");
If I created a job on 8 Sep 2022 at 09:42, I would want the job to be executed on 8 Oct 2022 at 09:42, while creating a job with
await agenda.every("0 0 1 * *", "delete old users");
Would instead run the job every 1st day of the month.
So what I'm wondering how would every 1 month define a newly created job?
await agenda.every("0 0 1 * *", "delete old users");
// OR
await agenda.every("42 9 8 * *", "delete old users");
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering when
every
will execute a job when defined with a time period instead of cron. In the README there is this exampleThis confuses me, are these the same? The first example could be read
run every 3 minutes
, while the second example could be read asrun at every 3rd minute
.The reason I'm asking is for example I want a job to be run every month:
If I created a job on 8 Sep 2022 at 09:42, I would want the job to be executed on 8 Oct 2022 at 09:42, while creating a job with
Would instead run the job every 1st day of the month.
So what I'm wondering how would
every 1 month
define a newly created job?Beta Was this translation helpful? Give feedback.
All reactions