Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-queue

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-queue - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

11

lib/queue.js

@@ -361,2 +361,4 @@ var uuid = require('node-uuid');

var self = this;
var emptyTicket = new Ticket();
ticket = ticket || emptyTicket;
var isUUID = false;

@@ -373,3 +375,5 @@ if (!taskId) {

var tickets = (self._writing[taskId] && self._writing[taskId].tickets) || new Tickets();
tickets.push(ticket);
if (ticket !== emptyTicket) {
tickets.push(ticket);
}

@@ -560,3 +564,2 @@ // Add to queue

}
self._startBatch(batch, tickets, lockId);

@@ -614,3 +617,5 @@ });

self.emit('task_retry', taskId, self._retries[taskId]);
self._queueTask(taskId, batch[taskId], tickets[taskId]);
setImmediate(function () {
self._queueTask(taskId, batch[taskId], tickets[taskId]);
})
}

@@ -617,0 +622,0 @@ })

@@ -15,3 +15,13 @@

Tickets.prototype.push = function (ticket) {
this.tickets.push(ticket);
var self = this;
if (ticket instanceof Tickets) {
return ticket.tickets.forEach(function (ticket) {
self.push(ticket)
})
}
if (ticket instanceof Ticket) {
if (self.tickets.indexOf(ticket) === -1) {
self.tickets.push(ticket);
}
}
}

@@ -18,0 +28,0 @@

{
"name": "better-queue",
"version": "3.6.1",
"version": "3.6.2",
"description": "Better Queue for NodeJS",

@@ -5,0 +5,0 @@ "main": "lib/queue.js",

@@ -292,3 +292,19 @@ var fs = require('fs');

it('failed task should not stack overflow', function (done) {
var count = 0;
var q = new Queue(function (n, cb) {
count++
if (count > 2000) {
cb();
done();
} else {
cb('fail');
}
}, {
maxRetries: Infinity
})
q.push(1);
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc