Skip to content

Commit 794c49d

Browse files
author
Tobias Gurtzick
committed
change to right license and update to type safe operations
1 parent c5f5840 commit 794c49d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/econ-refused/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"main": "econ-refused.js",
77
"author": "",
8-
"license": "ISC",
8+
"license": "MIT",
99
"dependencies": {
1010
"async": "^2.1.5",
1111
"request": "^2.79.0"

examples/low-response-time/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"main": "low-latency.js",
77
"author": "",
8-
"license": "ISC",
8+
"license": "MIT",
99
"dependencies": {
1010
"async": "^2.1.5"
1111
}

visigoth.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function api_remove_by(callback) {
8888
*/
8989
function api_choose_all(callback) {
9090
_(me.upstreams$).forEach(function(upstream, index) {
91-
if (upstream.meta$.status != "CLOSED") {
91+
if (upstream.meta$.status !== "CLOSED") {
9292
callback(upstream, index);
9393
}
9494
});
@@ -106,7 +106,7 @@ function api_choose(callback) {
106106

107107
_(me.upstreams$).forEach(function(upstream, index) {
108108
// Re-closing if the timeout has expired;
109-
if (upstream.meta$.status == 'OPEN') {
109+
if (upstream.meta$.status === 'OPEN') {
110110
if ((Date.now() - upstream.meta$.statusTimestamp) > me.closingTimeout$) {
111111
upstream.meta$.status = 'HALF-OPEN';
112112
upstream.meta$.statusTimestamp = Date.now();
@@ -117,19 +117,19 @@ function api_choose(callback) {
117117
upstream.meta$.status = 'OPEN';
118118
upstream.meta$.statusTimestamp = Date.now();
119119
}
120-
if (current > bestScore && upstream.meta$.status != "OPEN") {
120+
if (current > bestScore && upstream.meta$.status !== "OPEN") {
121121
bestScore = current;
122122
bestNode = index;
123123
}
124124
});
125-
125+
126126
if (bestScore > 0) {
127127
me.upstreams$[bestNode].meta$.lastChoosenTimestamp = Date.now();
128128
me.lastChoosenIndex$ = bestNode;
129-
129+
130130
callback(null, me.upstreams$[bestNode].target, this.failureStrategy$(me.upstreams$[bestNode]), me.upstreams$[bestNode].meta$.stats);
131131
// Close the circuit once it has been successful
132-
if (me.upstreams$[bestNode].meta$.status == "HALF-OPEN") {
132+
if (me.upstreams$[bestNode].meta$.status === "HALF-OPEN") {
133133
me.upstreams$[bestNode].meta$.status = "CLOSED";
134134
me.upstreams$[bestNode].meta$.statusTimestamp = Date.now();
135135
}

0 commit comments

Comments
 (0)