grantcarthew / node-rethinkdb-job-queue

A persistent job or task queue backed by RethinkDB.
https://github.com/grantcarthew/node-rethinkdb-job-queue/wiki
MIT License
156 stars 16 forks source link

masterInterval=false isn't being respected #15

Closed alexgorbatchev closed 8 years ago

alexgorbatchev commented 8 years ago
new Queue(connection, { 
  name: 'jobQueue',
  concurency: 10,
  masterInterval: false 
})

Produces the following log message

  [2016-10-03 00:52:24.304][db-review] enable +0ms 310000

However,

new Queue(connection, { 
  name: 'jobQueue',
  concurency: 10,
  masterInterval: 10000 
})

Produces the following log message

  [2016-10-03 00:52:24.373][db-review] enable +0ms 10000

This is due to

this._masterInterval = options.masterInterval ||
      enums.options.masterInterval

If options.masterInterval is false, it will default to enums.options.masterInterval. That should be something like

  this._masterInterval = typeof options.masterInterval !== 'undefined'
    ? options.masterInterval
    : enums.options.masterInterval
    ;
grantcarthew commented 8 years ago

Good find on this one @alexgorbatchev. One of those changes I though I made but didn't.

Fixed in v0.4.1

Thanks.

alexgorbatchev commented 8 years ago

👍