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

Commit 560367f4 by Sascha Depold

added method for joining an arbitrary amount of queries after finish

1 parent 1a315cdc
Showing with 10 additions and 0 deletions
...@@ -135,6 +135,16 @@ Sequelize.prototype = { ...@@ -135,6 +135,16 @@ Sequelize.prototype = {
}) })
connection.close() connection.close()
}) })
},
waitForQueries: function(queries, callback) {
var finishedQueries = 0
queries.forEach(function(query) {
query(function() {
finishedQueries++
if(finishedQueries == queries.length)
callback()
})
})
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!