Make sure the deferred query will be invoked only once
See https://groups.google.com/forum/#!topic/loopbackjs/Ez1cyQ0D0s0
This commit is contained in:
parent
02d974c281
commit
59edab6b12
|
@ -129,7 +129,7 @@ require('util').inherits(MySQL, SqlConnector);
|
||||||
MySQL.prototype.query = function (sql, callback) {
|
MySQL.prototype.query = function (sql, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (!this.dataSource.connected) {
|
if (!this.dataSource.connected) {
|
||||||
return this.dataSource.on('connected', function () {
|
return this.dataSource.once('connected', function () {
|
||||||
this.query(sql, callback);
|
this.query(sql, callback);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue