fix the "gc state" warning

This commit is contained in:
Kevin Jahns
2017-06-27 02:07:03 +02:00
parent 24facaab09
commit 409a9414f1
3 changed files with 26 additions and 13 deletions

View File

@@ -202,7 +202,8 @@ export default function extendConnector (Y/* :any */) {
if (!conn.isSynced) {
// it is crucial that isSynced is set at the time garbageCollectAfterSync is called
conn.isSynced = true
yield * this.garbageCollectAfterSync()
// It is safer to remove this!
// TODO: remove: yield * this.garbageCollectAfterSync()
// call whensynced listeners
for (var f of conn.whenSyncedListeners) {
f()
@@ -343,7 +344,8 @@ export default function extendConnector (Y/* :any */) {
}
defer.resolve()
})
/* then apply ds
/*
then apply ds
db.whenTransactionsFinished().then(() => {
db.requestTransaction(function * () {
yield * this.applyDeleteSet(m.deleteSet)

View File

@@ -39,6 +39,7 @@ export default function extendDatabase (Y /* :any */) {
*/
constructor (y, opts) {
this.y = y
opts.gc = opts.gc === true
this.dbOpts = opts
var os = this
this.userId = null
@@ -121,7 +122,7 @@ export default function extendDatabase (Y /* :any */) {
this.startRepairCheck()
}
startGarbageCollector () {
this.gc = this.dbOpts.gc == null || this.dbOpts.gc
this.gc = this.dbOpts.gc
if (this.gc) {
this.gcTimeout = !this.dbOpts.gcTimeout ? 50000 : this.dbOpts.gcTimeout
} else {