rethinkdbdash
Advanced tools
Comparing version 2.1.8 to 2.1.9
@@ -247,3 +247,3 @@ var Promise = require('bluebird'); | ||
var _len = arguments.length;var _args = new Array(_len); for(var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];} | ||
Term.prototype._arityRange(_args, 2, Infinity, 'r.and', this); | ||
Term.prototype._arityRange(_args, 1, Infinity, 'r.and', this); | ||
@@ -255,3 +255,3 @@ var term = new Term(this).expr(_args[0]); | ||
var _len = arguments.length;var _args = new Array(_len); for(var _i = 0; _i < _len; _i++) {_args[_i] = arguments[_i];} | ||
Term.prototype._arityRange(_args, 2, Infinity, 'r.or', this); | ||
Term.prototype._arityRange(_args, 1, Infinity, 'r.or', this); | ||
@@ -258,0 +258,0 @@ var term = new Term(this).expr(_args[0]); |
@@ -20,2 +20,3 @@ var util = require('util'); | ||
self._healthyPools = []; | ||
self._healthy = false; | ||
self._init = false; | ||
@@ -53,2 +54,3 @@ self._index = 0; // next pool to used | ||
self._healthyPools.push(pool); | ||
self.emitStatus() | ||
} | ||
@@ -65,2 +67,3 @@ } | ||
self._healthyPools.push(pool); | ||
self.emitStatus() | ||
} | ||
@@ -250,2 +253,3 @@ | ||
self._healthyPools.push(pool); | ||
self.emitStatus() | ||
self.resetBufferParameters(); | ||
@@ -421,2 +425,3 @@ } | ||
self._healthyPools.push(this); | ||
self.emitStatus() | ||
self.resetBufferParameters(); | ||
@@ -431,2 +436,3 @@ } | ||
self._healthyPools.splice(i, 1); | ||
self.emitStatus() | ||
break; | ||
@@ -445,2 +451,3 @@ } | ||
self._healthyPools.splice(i, 1); | ||
self.emitStatus() | ||
break; | ||
@@ -521,2 +528,12 @@ } | ||
// Emit the healthy event with a boolean indicating whether the pool master | ||
// is healthy or not | ||
PoolMaster.prototype.emitStatus = function() { | ||
var healthy = this._healthyPools.length !== 0; | ||
if (this._healthy !== healthy) { | ||
this._healthy = healthy; | ||
this.emit('healthy', healthy) | ||
} | ||
} | ||
module.exports = PoolMaster; |
{ | ||
"name": "rethinkdbdash", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"description": "A Node.js driver for RethinkDB with promises and a connection pool", | ||
@@ -10,3 +10,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"test": "mocha --check-leaks --harmony-generators -t 20000" | ||
"test": "mocha --check-leaks -t 20000" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
@@ -300,3 +300,3 @@ var config = require(__dirname+'/config.js'); | ||
catch(e) { | ||
if (e.message === "`r.and` takes at least 2 arguments, 0 provided.") { | ||
if (e.message === "`r.and` takes at least 1 argument, 0 provided.") { | ||
done(); | ||
@@ -309,15 +309,2 @@ } | ||
}) | ||
It('`and` should throw if just one argument has been passed -- r.and', function* (done) { | ||
try { | ||
var result = yield r.and(1).run(); | ||
} | ||
catch(e) { | ||
if (e.message === "`r.and` takes at least 2 arguments, 1 provided.") { | ||
done(); | ||
} | ||
else { | ||
done(e); | ||
} | ||
} | ||
}) | ||
It('`or` should work', function* (done) { | ||
@@ -351,3 +338,3 @@ try { | ||
catch(e) { | ||
if (e.message === "`r.or` takes at least 2 arguments, 0 provided.") { | ||
if (e.message === "`r.or` takes at least 1 argument, 0 provided.") { | ||
done(); | ||
@@ -360,15 +347,3 @@ } | ||
}) | ||
It('`or` should throw if just one argument has been passed -- r.or', function* (done) { | ||
try { | ||
var result = yield r.or(1).run(); | ||
} | ||
catch(e) { | ||
if (e.message === "`r.or` takes at least 2 arguments, 1 provided.") { | ||
done(); | ||
} | ||
else { | ||
done(e); | ||
} | ||
} | ||
}) | ||
It('`eq` should work', function* (done) { | ||
@@ -375,0 +350,0 @@ try { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
821298
24862