Comparing version 0.0.7 to 1.0.0
20
index.js
@@ -66,4 +66,16 @@ 'use strict' | ||
var watcher = consul.watch(consul.health.service, { service: service, passing: true }, function (err, res) { | ||
if (err) delete serviceCache[service] | ||
else serviceCache[service] = normaliseNodes(res) | ||
var nodes | ||
if (!err) { | ||
try { | ||
nodes = normaliseNodes(res) | ||
} catch (e) { | ||
err = e | ||
} | ||
} | ||
if (err) { | ||
delete serviceCache[service] | ||
} else { | ||
serviceCache[service] = nodes | ||
} | ||
}) | ||
@@ -83,2 +95,6 @@ | ||
if (!ret.length) { | ||
throw new Error("couldn't find any healthy service instances") | ||
} | ||
ret.random = function () { | ||
@@ -85,0 +101,0 @@ return this[Math.random() * this.length | 0] |
{ | ||
"name": "lsq", | ||
"version": "0.0.7", | ||
"version": "1.0.0", | ||
"description": "The programmatic interface to the lsq.io runtime environment.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4040
86
0