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

Commit 489bc658 by Mick Hansen

Merge pull request #5096 from Khez/fix-5083

fixes #5083 by passing full config options to replication
2 parents 4f4abdc8 c0b662bf
Showing with 3 additions and 17 deletions
...@@ -114,25 +114,11 @@ ConnectionManager.prototype.initPools = function () { ...@@ -114,25 +114,11 @@ ConnectionManager.prototype.initPools = function () {
} }
// Map main connection config // Map main connection config
config.replication.write = _.defaults(config.replication.write, { config.replication.write = _.defaults(config.replication.write, _.omit(config, 'replication'));
host: config.host,
port: config.port,
username: config.username,
password: config.password,
database: config.database,
pool: config.pool
});
// Apply defaults to each read config // Apply defaults to each read config
config.replication.read = _.map(config.replication.read, function(config) { config.replication.read = _.map(config.replication.read, function(readConfig) {
return _.defaults(config, { return _.defaults(readConfig, _.omit(self.config, 'replication'));
host: self.config.host,
port: self.config.port,
username: self.config.username,
password: self.config.password,
database: self.config.database,
pool: self.config.pool
});
}); });
// I'll make my own pool, with blackjack and hookers! (original credit goes to @janzeh) // I'll make my own pool, with blackjack and hookers! (original credit goes to @janzeh)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!