Skip to content

Commit

Permalink
Only emit 'stalled' event if there were stalled jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradvogel committed Oct 15, 2016
1 parent 00e213a commit 4124ecf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ Queue.prototype.processStalledJobs = function(grace){
return this.closing;
} else{
return scripts.processStalledJobs(this, grace).then(function(jobs){
_this.emit('stalled', jobs);
if(jobs.length > 0){
_this.emit('stalled', jobs);
}
return null;
}).catch(function(err){
console.error(err);
Expand Down

0 comments on commit 4124ecf

Please sign in to comment.