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

Commit ce49ac06 by Mick Hansen

Remove unneeded code

1 parent c76d53f3
Showing with 3 additions and 20 deletions
...@@ -164,11 +164,7 @@ module.exports = (function() { ...@@ -164,11 +164,7 @@ module.exports = (function() {
return queueItem.query; return queueItem.query;
} }
if (!this.isConnected && !this.pool) { var self = this, query = new Query(null, this.sequelize, callee, options || {});
this.connect()
}
var self = this, query = new Query(this.client, this.sequelize, callee, options || {});
this.pendingQueries++; this.pendingQueries++;
query.options.uuid = this.config.uuid query.options.uuid = this.config.uuid
...@@ -195,20 +191,6 @@ module.exports = (function() { ...@@ -195,20 +191,6 @@ module.exports = (function() {
return query; return query;
}; };
ConnectorManager.prototype.connect = function(callback) {
var self = this;
// in case database is slow to connect, prevent orphaning the client
if (this.isConnecting || this.pool) {
return;
}
connect.call(self, function(err, client) {
self.client = client;
callback(err, client);
return;
});
return;
};
ConnectorManager.prototype.getConnection = function(options, callback) { ConnectorManager.prototype.getConnection = function(options, callback) {
var self = this; var self = this;
...@@ -219,10 +201,11 @@ module.exports = (function() { ...@@ -219,10 +201,11 @@ module.exports = (function() {
return new Utils.CustomEventEmitter(function (emitter) { return new Utils.CustomEventEmitter(function (emitter) {
if (!self.pool) { if (!self.pool) {
// Regular client caching
if (self.client) { if (self.client) {
return emitter.emit('success', self.client); return emitter.emit('success', self.client);
} else { } else {
// Cache for concurrency // Cache for concurrent queries
if (self._getConnection) { if (self._getConnection) {
self._getConnection.proxy(emitter); self._getConnection.proxy(emitter);
return; return;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!