better-queue
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -308,7 +308,9 @@ var uuid = require('node-uuid'); | ||
// Task is in the queue -- update stats | ||
self.length++; | ||
if (self._queuedPeak < self.length) { | ||
self._queuedPeak = self.length; | ||
if (isNew) { | ||
self.length++; | ||
if (self._queuedPeak < self.length) { | ||
self._queuedPeak = self.length; | ||
} | ||
self._queuedTime[taskId] = new Date().getTime(); | ||
} | ||
self._queuedTime[taskId] = new Date().getTime(); | ||
@@ -315,0 +317,0 @@ // Notify the ticket |
{ | ||
"name": "better-queue", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "Better Queue for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "lib/queue.js", |
@@ -401,2 +401,20 @@ var assert = require('assert'); | ||
it('should merge but not batch until the delay has happened', function (done) { | ||
var running = false; | ||
var q = new Queue(function (arr) { | ||
running = true; | ||
}, { | ||
batchSize: 2, | ||
batchDelay: Infinity, | ||
id: 'id' | ||
}) | ||
setTimeout(function () { | ||
q.push({ id: 'a', x: 1 }); | ||
q.push({ id: 'a', x: 2 }); | ||
}, 1) | ||
setTimeout(function () { | ||
assert.ok(!running); | ||
done(); | ||
}, 10) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74321
1899