hypercore-storage 2.5.5 → 2.5.6

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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -429,6 +429,7 @@ class CorestoreStorage {
429
429
 
430
430
  this.bootstrap = storage !== null
431
431
  this.path = storage !== null ? storage : path.join(db.path, '..')
432
+ this.alwaysRecover = !!opts.alwaysRecover
432
433
  this.readOnly = !!opts.readOnly
433
434
  this.allowBackup = !!opts.allowBackup
434
435
  this.deviceFile = null
@@ -555,7 +556,7 @@ class CorestoreStorage {
555
556
  }
556
557
 
557
558
  _maybeRecoverLater(err) {
558
- if (!shouldRecover(err)) return
559
+ if (!shouldRecover(err) && !this.alwaysRecover) return
559
560
  fs.writeFileSync(path.join(this.db.path, 'RECOVERING'), '')
560
561
  for (const file of fs.readdirSync(this.db.path)) {
561
562
  if (file.endsWith('.log')) fs.unlinkSync(path.join(this.db.path, file))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-storage",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "main": "index.js",
5
5
  "files": [
6
6
  "index.js",