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

Commit 98bd1f44 by Sascha Depold

lol@english

1 parent 5546c264
Showing with 5 additions and 3 deletions
......@@ -8,7 +8,7 @@ module.exports = (function() {
this.emitters = []
this.fails = []
this.finished = false
this.runned = false
this.wasRunning = false
this.eventEmitter = null
emitters = emitters || []
......@@ -25,7 +25,7 @@ module.exports = (function() {
QueryChainer.prototype.run = function() {
var self = this
this.eventEmitter = new Utils.CustomEventEmitter(function() {
self.runned = true
self.wasRunning = true
finish.call(self)
})
return this.eventEmitter.run()
......@@ -49,7 +49,7 @@ module.exports = (function() {
var finish = function(result) {
this.finished = (this.finishedEmits == this.emitters.length)
if(this.finished && this.runned) {
if(this.finished && this.wasRunning) {
var status = this.fails.length == 0 ? 'success' : 'failure'
result = this.fails.length == 0 ? result : this.fails
this.eventEmitter.emit(status, result)
......
......@@ -27,6 +27,8 @@ module.exports = (function() {
return this
}
//private
var bindClient = function() {
this.client.on('error', this.bindClientFunction)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!