nsq-lookup-jc
Advanced tools
Comparing version 2.0.1 to 3.0.1
13
index.js
@@ -43,5 +43,12 @@ | ||
var retries = opts.retries || 2; | ||
var path = '/nodes'; | ||
if (!opts.topic) { | ||
return fn(new Error('invalid or missing topic'), null); | ||
// | ||
// This should be opt in. The cases where you are looking up nsqd instances | ||
// as an nsq-writer needs the ability to get all of the nodes if the topic | ||
// has not been created yet by a publish. We shouldn't limit the set of nodes | ||
// in that case. For readers this makes sense. | ||
// | ||
if (opts.topic) { | ||
path = '/lookup?topic=' + opts.topic; | ||
} | ||
@@ -53,3 +60,3 @@ | ||
request | ||
.get(addr + '/lookup?topic=' + opts.topic) | ||
.get(addr + path) | ||
.timeout(timeout) | ||
@@ -56,0 +63,0 @@ .retry(retries) |
{ | ||
"name": "nsq-lookup-jc", | ||
"version": "2.0.1", | ||
"version": "3.0.1", | ||
"repository": "segmentio/nsq-lookup", | ||
@@ -5,0 +5,0 @@ "description": "lookup nsqd instances via nsqlookupd", |
3804
117