autobee 2.11.3 → 2.11.4

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 +7 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -29,6 +29,7 @@ const migrations = require('./lib/migrations.js')
29
29
  const EMPTY_HEAD = { length: 0, key: null }
30
30
  const DEFAULT_ACK_THRESHOLD = 32
31
31
  const BOOT_NETWORK_TIMEOUT = 5000
32
+ const REINDEX_PREFETCH = 4096
32
33
  const INTERRUPT = new Error('Apply interrupted')
33
34
 
34
35
  module.exports = class Autobee extends ReadyResource {
@@ -150,6 +151,7 @@ module.exports = class Autobee extends ReadyResource {
150
151
  this._preapply = handlers.preapply || null
151
152
  this._preApplied = false
152
153
  this._reindexed = false
154
+ this._strictReindex = !!handlers.strictReindex
153
155
  this._warmup = handlers.warmup || null
154
156
  this._hasApply = !!handlers.apply
155
157
  this._hasUpdate = !!handlers.update
@@ -718,7 +720,9 @@ module.exports = class Autobee extends ReadyResource {
718
720
  return
719
721
  }
720
722
 
721
- await bee.reindex(async (change) => !(await this._shouldReindex(change.head.key)))
723
+ await bee.reindex(async (change) => !(await this._shouldReindex(change.head.key)), {
724
+ prefetch: REINDEX_PREFETCH
725
+ })
722
726
  bee.move({ key: local.key, length: local.length })
723
727
  }
724
728
 
@@ -733,7 +737,8 @@ module.exports = class Autobee extends ReadyResource {
733
737
  }
734
738
 
735
739
  if (core.manifest === null) return unknown
736
- return core.manifest.version > 1 && core.manifest.version < DEFAULT_MANIFEST_VERSION
740
+ if (core.manifest.version >= DEFAULT_MANIFEST_VERSION) return false
741
+ return this._strictReindex || core.manifest.version > 1
737
742
  } finally {
738
743
  await core.close()
739
744
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autobee",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "Bee based autobase",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Holepunch Inc.",