mirror of
https://github.com/knex/knex.git
synced 2025-12-30 00:30:14 +00:00
Proper fix for #510 and related
This commit is contained in:
parent
2abc48d73b
commit
239f906450
@ -101,10 +101,10 @@ Client_MySQL.prototype.acquireRawConnection = function() {
|
||||
var client = this;
|
||||
var connection = mysql.createConnection(this.connectionSettings);
|
||||
return new Promise(function(resolver, rejecter) {
|
||||
connection.on('error', connectionErrorHandler.bind(null, client, connection));
|
||||
connection.on('end', connectionErrorHandler.bind(null, client, connection));
|
||||
connection.connect(function(err) {
|
||||
if (err) return rejecter(err);
|
||||
connection.on('error', connectionErrorHandler.bind(null, client, connection));
|
||||
connection.on('end', connectionErrorHandler.bind(null, client, connection));
|
||||
resolver(connection);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user