question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[fix] Job does not repeat itself

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
titanismcommented, Jun 28, 2022

Ref https://github.com/breejs/bree/blob/master/src/index.js (look at the start and run functions)

1reaction
titanismcommented, Jun 28, 2022

bree.run will not consider interval, it only runs a job once

If you want jobs to start on an interval or schedule, use bree.start

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found