Skip to content

Commit 406357b

Browse files
committed
Better indication that pg.pools is a private api
1 parent 0aa62f2 commit 406357b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var PG = function(clientConstructor) {
1212
this.Client = clientConstructor;
1313
this.Query = this.Client.Query;
1414
this.Pool = Pool;
15-
this.pools = [];
15+
this._pools = [];
1616
this.Connection = Connection;
1717
this.types = require('pg-types');
1818
};
@@ -21,14 +21,14 @@ util.inherits(PG, EventEmitter);
2121

2222
PG.prototype.end = function() {
2323
var self = this;
24-
var keys = Object.keys(this.pools);
24+
var keys = Object.keys(this._pools);
2525
var count = keys.length;
2626
if(count === 0) {
2727
self.emit('end');
2828
} else {
2929
keys.forEach(function(key) {
30-
var pool = self.pools[key];
31-
delete self.pools[key];
30+
var pool = self._pools[key];
31+
delete self._pools[key];
3232
pool.pool.drain(function() {
3333
pool.pool.destroyAllNow(function() {
3434
count--;
@@ -58,8 +58,8 @@ PG.prototype.connect = function(config, callback) {
5858
config.idleTimeoutMillis = config.idleTimeoutMillis || config.poolIdleTimeout || defaults.poolIdleTimeout;
5959
config.log = config.log || config.poolLog || defaults.poolLog;
6060

61-
this.pools[poolName] = this.pools[poolName] || new Pool(config, this.Client);
62-
var pool = this.pools[poolName];
61+
this._pools[poolName] = this._pools[poolName] || new Pool(config, this.Client);
62+
var pool = this._pools[poolName];
6363
pool.connect(callback);
6464
if(!pool.listeners('error').length) {
6565
//propagate errors up to pg object

0 commit comments

Comments
 (0)