removed some unnecessary setTimeouts

This commit is contained in:
Kevin Jahns
2017-05-21 00:31:16 +02:00
parent 42abcc897c
commit 020dacdad4
2 changed files with 9 additions and 14 deletions

View File

@@ -240,11 +240,7 @@ export default function extendConnector (Y/* :any */) {
}
if (this.broadcastOpBuffer.length === 0) {
this.broadcastOpBuffer = ops
if (this.y.db.transactionInProgress) {
this.y.db.whenTransactionsFinished().then(broadcastOperations)
} else {
setTimeout(broadcastOperations, 0)
}
this.y.db.whenTransactionsFinished().then(broadcastOperations)
} else {
this.broadcastOpBuffer = this.broadcastOpBuffer.concat(ops)
}
@@ -365,6 +361,7 @@ export default function extendConnector (Y/* :any */) {
*/
defer.resolve()
})
return this.syncStep2
} else if (message.type === 'sync done') {
var self = this
this.syncStep2.then(function () {