@@ -13,7 +13,7 @@ var PG = function(clientConstructor) {
13
13
EventEmitter . call ( this ) ;
14
14
this . Client = clientConstructor ;
15
15
this . Connection = require ( __dirname + '/connection' ) ;
16
- this . Query = clientConstructor . Query
16
+ this . Query = clientConstructor . Query ;
17
17
this . defaults = defaults ;
18
18
} ;
19
19
@@ -25,8 +25,8 @@ PG.prototype.end = function() {
25
25
pool . drain ( function ( ) {
26
26
pool . destroyAllNow ( ) ;
27
27
} ) ;
28
- } )
29
- }
28
+ } ) ;
29
+ } ;
30
30
31
31
PG . prototype . connect = function ( config , callback ) {
32
32
var self = this ;
@@ -42,14 +42,14 @@ PG.prototype.connect = function(config, callback) {
42
42
var poolName = typeof ( c ) === 'string' ? c : c . user + c . host + c . port + c . database ;
43
43
var pool = pools [ poolName ] ;
44
44
45
- if ( pool ) return pool . acquire ( cb ) ;
45
+ if ( pool ) { return pool . acquire ( cb ) ; }
46
46
47
- var pool = pools [ poolName ] = genericPool . Pool ( {
47
+ pool = pools [ poolName ] = genericPool . Pool ( {
48
48
name : poolName ,
49
49
create : function ( callback ) {
50
50
var client = new self . Client ( c ) ;
51
51
client . connect ( function ( err ) {
52
- if ( err ) return callback ( err ) ;
52
+ if ( err ) { return callback ( err ) ; }
53
53
54
54
//handle connected client background errors by emitting event
55
55
//via the pg object and then removing errored client from the pool
@@ -74,17 +74,18 @@ PG.prototype.connect = function(config, callback) {
74
74
log : defaults . poolLog
75
75
} ) ;
76
76
return pool . acquire ( cb ) ;
77
- }
77
+ } ;
78
78
79
79
// cancel the query runned by the given client
80
80
PG . prototype . cancel = function ( config , client , query ) {
81
81
var c = config ;
82
82
//allow for no config to be passed
83
- if ( typeof c === 'function' )
83
+ if ( typeof c === 'function' ) {
84
84
c = defaults ;
85
+ }
85
86
var cancellingClient = new this . Client ( c ) ;
86
87
cancellingClient . cancel ( client , query ) ;
87
- }
88
+ } ;
88
89
89
90
module . exports = new PG ( Client ) ;
90
91
0 commit comments