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

Commit be208e8c by Nuno Sousa

Fix connection uuid on sql log

1 parent 532c05e5
...@@ -27,7 +27,7 @@ module.exports = (function() { ...@@ -27,7 +27,7 @@ module.exports = (function() {
this.sql = sql; this.sql = sql;
if (this.options.logging !== false) { if (this.options.logging !== false) {
this.sequelize.log('Executing (' + this.options.uuid + '): ' + this.sql); this.sequelize.log('Executing (' + this.client.uuid + '): ' + this.sql);
} }
var resultSet = [], var resultSet = [],
......
...@@ -32,7 +32,7 @@ module.exports = (function() { ...@@ -32,7 +32,7 @@ module.exports = (function() {
, rows = []; , rows = [];
if (this.options.logging !== false) { if (this.options.logging !== false) {
this.sequelize.log('Executing (' + this.options.uuid + '): ' + this.sql); this.sequelize.log('Executing (' + this.client.uuid + '): ' + this.sql);
} }
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
...@@ -45,7 +45,7 @@ module.exports = (function() { ...@@ -45,7 +45,7 @@ module.exports = (function() {
query.on('error', function(err) { query.on('error', function(err) {
receivedError = true; receivedError = true;
err.sql = sql; err.sql = sql;
promise.emit('sql', sql, self.options.uuid); promise.emit('sql', sql, self.client.uuid);
reject(err); reject(err);
}); });
...@@ -54,7 +54,7 @@ module.exports = (function() { ...@@ -54,7 +54,7 @@ module.exports = (function() {
return; return;
} }
promise.emit('sql', self.sql, self.options.uuid); promise.emit('sql', self.sql, self.client.uuid);
resolve([rows, sql, result]); resolve([rows, sql, result]);
}); });
}).spread(function(rows, sql, result) { }).spread(function(rows, sql, result) {
......
...@@ -30,7 +30,7 @@ module.exports = (function() { ...@@ -30,7 +30,7 @@ module.exports = (function() {
this.sql = sql; this.sql = sql;
if (this.options.logging !== false) { if (this.options.logging !== false) {
this.sequelize.log('Executing (' + this.options.uuid + '): ' + this.sql); this.sequelize.log('Executing (' + this.database.uuid + '): ' + this.sql);
} }
return new Utils.Promise(function(resolve) { return new Utils.Promise(function(resolve) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!