From f36cf49b766f32e93cd33416618c6cb1b9149561 Mon Sep 17 00:00:00 2001 From: jrad Date: Tue, 24 Mar 2015 16:07:53 +0430 Subject: [PATCH] Turn off search indexes by default, Closes #412 --- History.md | 3 ++- Readme.md | 4 ++-- lib/kue.js | 2 +- lib/queue/job.js | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/History.md b/History.md index 0b30c599..920dbe10 100755 --- a/History.md +++ b/History.md @@ -3,8 +3,9 @@ * Upgrade to express 4.x, Closes #537 * Move `job.process` done callback to the last, Closes #387, Closes #385 -* Document Javascript API to query queue state, Closes #455 * Standardize signature of `.shutdown()` callback, Closes #454 +* Turn off search indexes by default, Closes #412 +* Document Javascript API to query queue state, Closes #455 diff --git a/Readme.md b/Readme.md index e223dcfb..2b282ab5 100755 --- a/Readme.md +++ b/Readme.md @@ -620,12 +620,12 @@ queue.create('email', { }).searchKeys( ['to', 'title'] ).save(); ``` -You may also fully disable search indexes for redis memory optimization: +Search feature is turned off by default from Kue `>=0.9.0`. Read more about this [here](https://github.com/LearnBoost/kue/issues/412). You should enable search indexes in you need to: ```javascript var kue = require('kue'); q = kue.createQueue({ - disableSearch: true + disableSearch: false }); ``` diff --git a/lib/kue.js b/lib/kue.js index ca86c812..61076368 100755 --- a/lib/kue.js +++ b/lib/kue.js @@ -88,7 +88,7 @@ function Queue( options ) { this.promoter = null; this.workers = exports.workers; this.shuttingDown = false; - Job.disableSearch = options.disableSearch; + Job.disableSearch = options.disableSearch !== false; } /** diff --git a/lib/queue/job.js b/lib/queue/job.js index 290665f1..740fba98 100644 --- a/lib/queue/job.js +++ b/lib/queue/job.js @@ -401,7 +401,6 @@ Job.prototype.delay = function (ms) { if(ms > 0) { this._delay = ms; } -// this._state = 'delayed'; return this; };