hypercore
Advanced tools
Comparing version 11.0.5 to 11.0.6
@@ -22,2 +22,6 @@ const crypto = require('hypercore-crypto') | ||
// small hack to close old storages as late as possible. | ||
// TODO: add a read lock so we can avoid that | ||
this.lingers = null | ||
this.parent = parent | ||
@@ -139,2 +143,6 @@ this.mutex = new Mutex() | ||
if (this.lingers !== null) { | ||
for (const storage of this.lingers) await storage.close() | ||
} | ||
return closing | ||
@@ -235,2 +243,5 @@ } | ||
if (src.core !== this.core) { | ||
if (this.lingers === null) this.lingers = [] | ||
this.lingers.push(this.storage) | ||
this.prologue = src.prologue | ||
@@ -247,4 +258,2 @@ this.storage = await src.core.state.storage.resumeSession(this.name) | ||
this._moveToCore(src.core) | ||
await this.storage.close() | ||
} | ||
@@ -807,3 +816,4 @@ | ||
if (!this.isSnapshot()) { | ||
const oldStorage = this.storage | ||
if (this.lingers === null) this.lingers = [] | ||
this.lingers.push(this.storage) | ||
@@ -838,4 +848,2 @@ const truncation = length < this.length ? await truncateAndFlush(this, length) : null | ||
} | ||
await oldStorage.close() | ||
} | ||
@@ -842,0 +850,0 @@ |
{ | ||
"name": "hypercore", | ||
"version": "11.0.5", | ||
"version": "11.0.6", | ||
"description": "Hypercore is a secure, distributed append-only log", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
283883
8055