hypercore-storage 2.5.5 → 2.5.7
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 +3 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -127,6 +127,7 @@ class HypercoreStorage {
|
|
|
127
127
|
dataPointer: dep.dataPointer,
|
|
128
128
|
length: dep.length
|
|
129
129
|
}
|
|
130
|
+
return // updated head so done
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
this.core.dependencies = [
|
|
@@ -429,6 +430,7 @@ class CorestoreStorage {
|
|
|
429
430
|
|
|
430
431
|
this.bootstrap = storage !== null
|
|
431
432
|
this.path = storage !== null ? storage : path.join(db.path, '..')
|
|
433
|
+
this.alwaysRecover = !!opts.alwaysRecover
|
|
432
434
|
this.readOnly = !!opts.readOnly
|
|
433
435
|
this.allowBackup = !!opts.allowBackup
|
|
434
436
|
this.deviceFile = null
|
|
@@ -555,7 +557,7 @@ class CorestoreStorage {
|
|
|
555
557
|
}
|
|
556
558
|
|
|
557
559
|
_maybeRecoverLater(err) {
|
|
558
|
-
if (!shouldRecover(err)) return
|
|
560
|
+
if (!shouldRecover(err) && !this.alwaysRecover) return
|
|
559
561
|
fs.writeFileSync(path.join(this.db.path, 'RECOVERING'), '')
|
|
560
562
|
for (const file of fs.readdirSync(this.db.path)) {
|
|
561
563
|
if (file.endsWith('.log')) fs.unlinkSync(path.join(this.db.path, file))
|