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

Commit 442b146e by Sascha Depold

Merge branch 'master' of github.com:sequelize/sequelize

2 parents c22a6191 fbc3189b
Showing with 4 additions and 3 deletions
...@@ -72,8 +72,9 @@ module.exports = (function() { ...@@ -72,8 +72,9 @@ module.exports = (function() {
var emitter = new (require('events').EventEmitter)() var emitter = new (require('events').EventEmitter)()
// in case database is slow to connect, prevent orphaning the client // in case database is slow to connect, prevent orphaning the client
if (this.isConnecting && !this.pooling) { // TODO: We really need some sort of queue/flush/drain mechanism
emitter.emit('success') if (this.isConnecting && !this.pooling && this.client === null) {
emitter.emit('success', null)
return emitter return emitter
} }
...@@ -118,7 +119,7 @@ module.exports = (function() { ...@@ -118,7 +119,7 @@ module.exports = (function() {
if (this.pooling) { if (this.pooling) {
// acquire client from pool // acquire client from pool
this.poolIdentifier = this.pg.pools.getOrCreate(this.sequelize.config) this.poolIdentifier = this.pg.pools.getOrCreate(uri)
this.poolIdentifier.connect(connectCallback) this.poolIdentifier.connect(connectCallback)
} else { } else {
if (!!this.client) { if (!!this.client) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!