corestore 7.0.21 → 7.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -229,7 +229,7 @@ class Corestore extends ReadyResource {
|
|
|
229
229
|
super()
|
|
230
230
|
|
|
231
231
|
this.root = opts.root || null
|
|
232
|
-
this.storage = this.root ? this.root.storage : Hypercore.defaultStorage(storage)
|
|
232
|
+
this.storage = this.root ? this.root.storage : Hypercore.defaultStorage(storage, { id: opts.id })
|
|
233
233
|
this.streamTracker = this.root ? this.root.streamTracker : new StreamTracker()
|
|
234
234
|
this.cores = this.root ? this.root.cores : new CoreTracker()
|
|
235
235
|
this.sessions = new SessionTracker()
|
|
@@ -287,8 +287,9 @@ class Corestore extends ReadyResource {
|
|
|
287
287
|
return auditStore(this, opts)
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
suspend () {
|
|
291
|
-
|
|
290
|
+
async suspend () {
|
|
291
|
+
await this.storage.db.flush()
|
|
292
|
+
await this.storage.db.suspend()
|
|
292
293
|
}
|
|
293
294
|
|
|
294
295
|
resume () {
|