Skip to content

Commit 52aa25d

Browse files
martinkubabrianc
authored andcommitted
added Client constructor back on pool to enable instrumentation (brianc#998)
1 parent fe6f32a commit 52aa25d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pool.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var genericPool = require('generic-pool');
66

77
module.exports = function(Client) {
88
var pools = {
9+
Client: Client,
910
//dictionary of all key:pool pairs
1011
all: {},
1112
//reference to the client constructor - can override in tests or for require('pg').native
@@ -23,7 +24,7 @@ module.exports = function(Client) {
2324
reapIntervalMillis: clientConfig.reapIntervalMillis || defaults.reapIntervalMillis,
2425
log: clientConfig.poolLog || defaults.poolLog,
2526
create: function(cb) {
26-
var client = new Client(clientConfig);
27+
var client = new pools.Client(clientConfig);
2728
// Ignore errors on pooled clients until they are connected.
2829
client.on('error', Function.prototype);
2930
client.connect(function(err) {

0 commit comments

Comments
 (0)