found some gc bugs that occur when using deletion lengths

This commit is contained in:
Kevin Jahns
2016-04-25 13:09:52 +02:00
parent 90b7b01e9a
commit 71bf6438e1
3 changed files with 16 additions and 14 deletions

View File

@@ -113,6 +113,11 @@ module.exports = function (Y /* :any */) {
garbageCollect()
}
}
queueGarbageCollector (id) {
if (this.y.isConnected()) {
this.gc1.push(id)
}
}
emptyGarbageCollector () {
return new Promise(resolve => {
var check = () => {
@@ -185,9 +190,7 @@ module.exports = function (Y /* :any */) {
if (gc) {
op.gc = true
yield* this.setOperation(op)
if (this.store.y.connector.isSynced) {
this.store.gc1.push(op.id)
}
this.store.queueGarbageCollector(op.id)
return true
}
}