Callback in subscriber unsubscribe errors

This commit is contained in:
Raul Ochoa 2016-10-12 12:29:54 +02:00
parent c74f9bcce0
commit 67566c1d0e

View File

@ -62,9 +62,11 @@ JobSubscriber.prototype.subscribe = function (onJobHandler, callback) {
seeker(this.queueSeeker, onJobHandler, callback);
};
JobSubscriber.prototype.unsubscribe = function () {
JobSubscriber.prototype.unsubscribe = function (callback) {
clearInterval(this.seekerInterval);
if (this.client && this.client.connected) {
this.client.unsubscribe(Channel.NAME);
this.client.unsubscribe(Channel.NAME, callback);
} else {
return callback(null);
}
};