Comparing version 6.0.4 to 6.0.5
@@ -398,2 +398,3 @@ const b4a = require('b4a') | ||
this.reindexing = false | ||
this.emit('reindexed') | ||
} catch (err) { | ||
@@ -587,3 +588,4 @@ safetyCatch(err) | ||
while (!this.closing && this.localWriter.core.length > this.localWriter.length) { | ||
await this._bump() | ||
await this.localWriter.waitForSynced() | ||
await this._bump() // make sure its all flushed... | ||
} | ||
@@ -590,0 +592,0 @@ |
@@ -8,2 +8,3 @@ const Linearizer = require('./linearizer') | ||
const assert = require('nanoassert') | ||
const SignalPromise = require('signal-promise') | ||
@@ -28,2 +29,3 @@ const MAX_PRELOAD = 4 | ||
this.pendingCheckpoints = [] | ||
this.syncSignal = null | ||
} | ||
@@ -44,2 +46,8 @@ | ||
waitForSynced () { | ||
if (this.core.length === this.length) return Promise.resolve() | ||
if (this.syncSignal === null) this.syncSignal = new SignalPromise() | ||
return this.syncSignal.wait() | ||
} | ||
async _open () { | ||
@@ -81,2 +89,3 @@ await this.core.ready() | ||
_close () { | ||
if (this.syncSignal !== null) this.syncSignal.notify() | ||
return this.core.close() | ||
@@ -107,2 +116,3 @@ } | ||
advance () { | ||
if (this.syncSignal !== null && this.length + 1 === this.core.length) this.syncSignal.notify() | ||
return this.length < this.available ? this.nodes.get(this.length++) : null | ||
@@ -109,0 +119,0 @@ } |
{ | ||
"name": "autobase", | ||
"version": "6.0.4", | ||
"version": "6.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164085
4387