@@ -12,7 +12,7 @@ var PG = function(clientConstructor) {
12
12
this . Client = clientConstructor ;
13
13
this . Query = this . Client . Query ;
14
14
this . Pool = Pool ;
15
- this . pools = [ ] ;
15
+ this . _pools = [ ] ;
16
16
this . Connection = Connection ;
17
17
this . types = require ( 'pg-types' ) ;
18
18
} ;
@@ -21,14 +21,14 @@ util.inherits(PG, EventEmitter);
21
21
22
22
PG . prototype . end = function ( ) {
23
23
var self = this ;
24
- var keys = Object . keys ( this . pools ) ;
24
+ var keys = Object . keys ( this . _pools ) ;
25
25
var count = keys . length ;
26
26
if ( count === 0 ) {
27
27
self . emit ( 'end' ) ;
28
28
} else {
29
29
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 ] ;
32
32
pool . pool . drain ( function ( ) {
33
33
pool . pool . destroyAllNow ( function ( ) {
34
34
count -- ;
@@ -58,8 +58,8 @@ PG.prototype.connect = function(config, callback) {
58
58
config . idleTimeoutMillis = config . idleTimeoutMillis || config . poolIdleTimeout || defaults . poolIdleTimeout ;
59
59
config . log = config . log || config . poolLog || defaults . poolLog ;
60
60
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 ] ;
63
63
pool . connect ( callback ) ;
64
64
if ( ! pool . listeners ( 'error' ) . length ) {
65
65
//propagate errors up to pg object
0 commit comments