Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Emit a 'stalled' event." (it's misleading) #257

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ A queue emits also some useful events:
// Job started
// You can use jobPromise.cancel() to abort this job.
})
.on('stalled', function(job){
// The job was considered stalled (i.e. its lock was not renewed in LOCK_RENEW_TIME).
// Useful for debugging job workers that crash or pause the event loop.
})
.on('progress', function(job, progress){
// Job progress updated!
})
Expand Down
1 change: 0 additions & 1 deletion lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ Queue.prototype.processStalledJob = function(job){
var key = _this.toKey('completed');
return _this.client.sismemberAsync(key, job.jobId).then(function(isMember){
if(!isMember){
_this.emit('stalled', job);
return _this.processJob(job);
}
});
Expand Down
4 changes: 0 additions & 4 deletions test/test_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,12 @@ describe('Queue', function () {
});

setTimeout(function(){
var stalledCallback = sandbox.spy();

return queueStalled.disconnect().then(function(){
var queue2 = new Queue('test queue stalled', 6379, '127.0.0.1');
var doneAfterFour = _.after(4, function () {
expect(stalledCallback.calledOnce).to.be(true);
done();
});
queue2.on('completed', doneAfterFour);
queue2.on('stalled', stalledCallback);

queue2.process(function (job, jobDone2) {
jobDone2();
Expand Down