hypercore-storage 3.1.0 → 3.1.2

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 +9 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -947,7 +947,7 @@ class CorestoreStorage {
947
947
  const core = await promise
948
948
 
949
949
  if (core === null) return false
950
- if (core.version !== VERSION && ifMigrated) return false
950
+ if (core.version === 0 && ifMigrated) return false
951
951
 
952
952
  return true
953
953
  }
@@ -1006,9 +1006,15 @@ class CorestoreStorage {
1006
1006
  return Promise.all(resultPromises)
1007
1007
  }
1008
1008
 
1009
- async suspend() {
1009
+ async suspend({ log = noop } = {}) {
1010
+ await log('Suspending hypercore storage...')
1010
1011
  await this.db.suspend()
1011
- if (this.deviceFile) await this.deviceFile.suspend()
1012
+ await log('db suspended')
1013
+ if (this.deviceFile) {
1014
+ await log('suspend deviceFile')
1015
+ await this.deviceFile.suspend()
1016
+ await log('deviceFile suspended')
1017
+ }
1012
1018
  }
1013
1019
 
1014
1020
  async resume() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore-storage",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "main": "index.js",
5
5
  "files": [
6
6
  "index.js",