corestore 7.3.0 → 7.4.1
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 +5 -2
- 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, { id: opts.id })
|
|
232
|
+
this.storage = this.root ? this.root.storage : Hypercore.defaultStorage(storage, { id: opts.id, allowBackup: opts.allowBackup })
|
|
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()
|
|
@@ -286,9 +286,12 @@ class Corestore extends ReadyResource {
|
|
|
286
286
|
return auditStore(this, opts)
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
async suspend () {
|
|
289
|
+
async suspend ({ log = noop } = {}) {
|
|
290
|
+
log('Flushing db...')
|
|
290
291
|
await this.storage.db.flush()
|
|
292
|
+
log('Suspending db...')
|
|
291
293
|
await this.storage.db.suspend()
|
|
294
|
+
log('Corestore suspended')
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
resume () {
|