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

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() {
return queueItem.query;
}
if (!this.isConnected && !this.pool) {
this.connect()
}
var self = this, query = new Query(this.client, this.sequelize, callee, options || {});
var self = this, query = new Query(null, this.sequelize, callee, options || {});
this.pendingQueries++;
query.options.uuid = this.config.uuid
......@@ -195,20 +191,6 @@ module.exports = (function() {
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) {
var self = this;
......@@ -219,10 +201,11 @@ module.exports = (function() {
return new Utils.CustomEventEmitter(function (emitter) {
if (!self.pool) {
// Regular client caching
if (self.client) {
return emitter.emit('success', self.client);
} else {
// Cache for concurrency
// Cache for concurrent queries
if (self._getConnection) {
self._getConnection.proxy(emitter);
return;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!