Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,17 @@ class Corestore extends ReadyResource {
}

async suspend({ log = noop } = {}) {
await log('Flushing db...')
log('Corestore suspension requested.')
// If readOnly we don't need to flush
if (!this.storage.readOnly) {
log('Flushing db...')
await this.storage.db.flush()
await log('Flusing db completed')
log('Flushing db completed')
}
if (!this.shouldSuspend) return
await log('Suspending db...')
log('Suspending db...')
await this.storage.suspend({ log })
await log('Suspending db completed')
log('Suspending db completed')
}

resume() {
Expand Down
Loading