From 67566c1d0eb61f61d99e4d4578b5053b85545592 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 12 Oct 2016 12:29:54 +0200 Subject: [PATCH] Callback in subscriber unsubscribe errors --- batch/pubsub/job-subscriber.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/batch/pubsub/job-subscriber.js b/batch/pubsub/job-subscriber.js index 43f56a75..af450a0b 100644 --- a/batch/pubsub/job-subscriber.js +++ b/batch/pubsub/job-subscriber.js @@ -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); } };