@@ -88,7 +88,7 @@ function api_remove_by(callback) {
8888 */
8989function 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