breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.06k stars 79 forks source link

Functional job always running on start, although interval is given #30

Closed jdalrymple closed 4 years ago

jdalrymple commented 4 years ago

Regardless of the interval, the task is run on start. I dont think i missed an option to skip running on start.

function test () { console.log('yay') }

const bree = new Bree({
  root: false,
  jobs: [
    {
      name: 'snapshot',
      path: test,
      interval: '10s'
    }
  ]
});

bree.start()
niftylettuce commented 4 years ago

Thanks for the heads up, will look at this ASAP unless @shadowgate15 gets to it before myself.

niftylettuce commented 4 years ago

Please upgrade to v3.1.0 as these issues are fixed. I have also published an npm deprecation notice for older versions.

niftylettuce commented 4 years ago

If you don't want the job to start immediately, either set timeout: false as a global or job-specific option.