Giter Club home page Giter Club logo

Comments (5)

titanism avatar titanism commented on June 13, 2024 1

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

from bree.

titanism avatar titanism commented on June 13, 2024 1

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

from bree.

titanism avatar titanism commented on June 13, 2024

What does your job createUrlJobs look like?

Also, do you have a typo here?

It currently exists the program once it finishes executing the job.

"Exists" -> "Exits"?

Have you tried running NODE_DEBUG=bree node app.js?

What version of Bree are you using?

from bree.

omar-dulaimi avatar omar-dulaimi commented on June 13, 2024

@titanism I meant exits, my bad.

The createUrlJobs job has another bree instance.

const bree = new Bree({
   doRootCheck: false,
});
  
(async () => {
  await bree.start();
  for (const clientEndpoint of clientEndpoints) {
    const url = `https://${clientEndpoint}`;
    const duration = randomDuration(1, 59);
    await bree.add([
      {
        name: `capture-url-${clientEndpoint}`,
        path: path.resolve(__dirname, "capture-url.js"),
        date: dayjs().add(duration, "seconds").toDate(),
        worker: {
          workerData: {
            clientEndpoint,
            url,
          },
        },
      },
    ]);

    await bree.run(`capture-url-${clientEndpoint}`);
  }
})();

Using ^9.0.1

from bree.

omar-dulaimi avatar omar-dulaimi commented on June 13, 2024

@titanism Thanks man. I missed this part in the README:

// run all jobs (this does not abide by timeout/interval/cron and spawns workers immediately)

from bree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.