implemented small lookup buffer. This heavily improves lookups for slow databases

This commit is contained in:
Kevin Jahns
2016-01-22 14:09:51 +01:00
parent 37ac7787d0
commit 1b3f5443b3
2 changed files with 165 additions and 9 deletions

View File

@@ -403,16 +403,12 @@ module.exports = function (Y /* :any */) {
}
}
requestTransaction (makeGen/* :any */, callImmediately) {
if (false || callImmediately) { // TODO: decide whether this is ok or not..
this.waitingTransactions.push(makeGen)
if (!this.transactionInProgress) {
this.transactionInProgress = true
this.waitingTransactions.push(makeGen)
if (!this.transactionInProgress) {
this.transactionInProgress = true
if (true || callImmediately) { // TODO: decide whether this is ok or not..
this.transact(this.getNextRequest())
}
} else {
this.waitingTransactions.push(makeGen)
if (!this.transactionInProgress) {
this.transactionInProgress = true
} else {
var self = this
setTimeout(function () {
self.transact(self.getNextRequest())