Comparing version 2.4.1 to 2.4.2
@@ -198,3 +198,3 @@ 'use strict'; | ||
return self._waitMetadata().then(function () { | ||
function _try() { | ||
if (self.topicMetadata.hasOwnProperty(topic)) { | ||
@@ -204,2 +204,7 @@ return self.topicMetadata[topic]; | ||
throw errors.byName('UnknownTopicOrPartition'); | ||
} | ||
return self._waitMetadata().then(_try) | ||
.catch({ code: 'UnknownTopicOrPartition' }, function () { | ||
return self.updateMetadata().then(_try); | ||
}) | ||
@@ -212,3 +217,3 @@ .then(_.values); | ||
return self._waitMetadata().then(function () { | ||
function _try() { | ||
var r = _.get(self.topicMetadata, [topic, partition, 'leader'], notfoundOK ? parseInt(_.keys(self.brokerConnections)[0]) : -1); | ||
@@ -222,2 +227,7 @@ if (r === -1) { | ||
return r; | ||
} | ||
return self._waitMetadata().then(_try) | ||
.catch({ code: 'UnknownTopicOrPartition' }, { code: 'LeaderNotAvailable' }, function () { | ||
return self.updateMetadata().then(_try); | ||
}); | ||
@@ -224,0 +234,0 @@ }; |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"main": "./lib/index.js", | ||
@@ -12,0 +12,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
240154
4330