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

Commit 1c0d3e10 by Mick Hansen

fix(replication): mysql needs access to pool settings

1 parent 86ee3d5b
......@@ -13,7 +13,7 @@ var Pooling = require('generic-pool')
, ConnectionManager;
ConnectionManager = function(dialect, sequelize) {
var config = sequelize.config;
var config = _.cloneDeep(sequelize.config);
this.sequelize = sequelize;
this.config = config;
......@@ -85,7 +85,7 @@ ConnectionManager.prototype.close = function () {
// If he does this, generic-pool will try to call connect before the dialect-specific connection manager has been correctly set up
ConnectionManager.prototype.initPools = function () {
var self = this
, config = _.cloneDeep(this.config);
, config = this.config;
if (!config.replication) {
this.pool = Pooling.Pool({
......@@ -119,7 +119,8 @@ ConnectionManager.prototype.initPools = function () {
port: config.port,
username: config.username,
password: config.password,
database: config.database
database: config.database,
pool: config.pool
});
// Apply defaults to each read config
......@@ -129,7 +130,8 @@ ConnectionManager.prototype.initPools = function () {
port: self.config.port,
username: self.config.username,
password: self.config.password,
database: self.config.database
database: self.config.database,
pool: self.config.pool
});
});
......
......@@ -14,7 +14,6 @@ describe(Support.getTestDialectTeaser('Replication'), function() {
beforeEach(function () {
this.sequelize = Support.getSequelizeInstance(null, null, null, {
replication: {
// Just need empty objects, sequelize will copy in defaults
write: Support.getConnectionOptions(),
read: [Support.getConnectionOptions()]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!