[fix] Job does not repeat itself
See original GitHub issueDescribe the bug
Node.js version: v14.19.3
OS version: Ubuntu 18.04
Description:
Hello
I’m facing a weird issue, where a job with 1m
interval does not repeat itself.
Actual behavior
It currently exits the program once it finishes executing the job.
Expected behavior
It should not exit, knowing that the interval is 1m
Code to reproduce
import Bree from "bree";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const bree = new Bree({ doRootCheck: false });
(async () => {
await bree.start();
const jobName = `createUrlJobs`;
await bree.add({
name: jobName,
path: path.resolve(__dirname, "..", "jobs", "createUrlJobs.js"),
interval: "1m",
timeout: 0, // start immediately
});
await bree.run(jobName);
console.log(JSON.stringify(bree.config.jobs));
})();
Checklist
- I have searched through GitHub issues for similar issues.
- I have completely read through the README and documentation.
- I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
Note: I have tested the issue with both node 14 and 16, I couldn’t with node 18 since it requires me to upgrade my OS.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Tricky repeating Scheduled Task flaw in Server 2016 ...
I believe the original issue (bug) is when a scheduled task is either originally set up or is modified. The start date is...
Read more >Tidal 6.1 Repeating Job (SAME OCCURRENCE) "Completed ...
This is normal behavior where by if a job repeating with the same occurrence, the next job iteration will not start unless it...
Read more >Cron job does not repeat
1) On the cron jobs themselves, set eac to "Enable parallel run" in the case that they are called when one is already...
Read more >What does Mark Twain's phrase “history never repeats itself ...
I think it means that things don't happen exactly the same as the previous instance (repeat) but they come back in a similar...
Read more >The Power of Repetition: the #1 Secret of Successful Leaders
The power of repetition is not just about fixing problems. It can also help you when you're looking to praise and reward your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ref https://github.com/breejs/bree/blob/master/src/index.js (look at the start and run functions)
bree.run
will not considerinterval
, it only runs a job onceIf you want jobs to start on an interval or schedule, use
bree.start