File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const validOptions = {
48
48
// These options are used for Pool
49
49
connectionLimit : 1 ,
50
50
maxIdle : 1 ,
51
- idleTimeout : 60000 ,
51
+ idleTimeout : 1 ,
52
52
Promise : 1 ,
53
53
queueLimit : 1 ,
54
54
waitForConnections : 1
Original file line number Diff line number Diff line change @@ -105,7 +105,10 @@ exports.getConfig = function(input) {
105
105
timezone : args && args . timezone ,
106
106
dateStrings : args && args . dateStrings ,
107
107
authSwitchHandler : args && args . authSwitchHandler ,
108
- typeCast : args && args . typeCast
108
+ typeCast : args && args . typeCast ,
109
+ connectionLimit : args && args . connectionLimit ,
110
+ maxIdle : args && args . maxIdle ,
111
+ idleTimeout : args && args . idleTimeout ,
109
112
} ;
110
113
return params ;
111
114
} ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const createPool = require ( '../common.js' ) . createPool ;
4
- const config = require ( '../common.js' ) . config ;
5
4
const assert = require ( 'assert' ) ;
6
5
7
- const options = Object . assign ( {
6
+ const pool = new createPool ( {
8
7
connectionLimit : 5 , // 5 connections
9
8
maxIdle : 1 , // 1 idle connection
10
9
idleTimeout : 5000 , // 5 seconds
11
- } , config ) ;
12
- const pool = new createPool ( options ) ;
10
+ } ) ;
13
11
14
12
pool . getConnection ( ( err1 , connection1 ) => {
15
13
assert . ifError ( err1 ) ;
You can’t perform that action at this time.
0 commit comments