不要怂,就是干,撸起袖子干!

Commit 3ae5faa8 by Dominik Lessel

Added: minConnections option for pooling

1 parent 83f5e281
Showing with 4 additions and 0 deletions
...@@ -24,6 +24,9 @@ module.exports = (function() { ...@@ -24,6 +24,9 @@ module.exports = (function() {
if (!this.poolCfg.maxConnections) { if (!this.poolCfg.maxConnections) {
this.poolCfg.maxConnections = 10 this.poolCfg.maxConnections = 10
} }
if (!this.poolCfg.minConnections) {
this.poolCfg.minConnections = 0
}
this.pool = Pooling.Pool({ this.pool = Pooling.Pool({
name: 'sequelize-mysql', name: 'sequelize-mysql',
create: function (done) { create: function (done) {
...@@ -33,6 +36,7 @@ module.exports = (function() { ...@@ -33,6 +36,7 @@ module.exports = (function() {
disconnect.call(self, client) disconnect.call(self, client)
}, },
max: self.poolCfg.maxConnections, max: self.poolCfg.maxConnections,
min: self.poolCfg.minConnections,
idleTimeoutMillis: self.poolCfg.maxIdleTime idleTimeoutMillis: self.poolCfg.maxIdleTime
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!