pinokiod 8.0.50 → 8.0.53

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/kernel/index.js CHANGED
@@ -1217,21 +1217,12 @@ class Kernel {
1217
1217
  await this.git.loadCheckpoints()
1218
1218
  console.timeEnd("git.loadCheckpoints")
1219
1219
 
1220
- // Shared model store: registry verification only at startup never a
1221
- // discovery walk (spec/requirements/shared-model-store.md, trigger 5).
1220
+ // Shared model store: startup reads only the enable flag. Registry and
1221
+ // filesystem initialization are deferred until a Vault page or action
1222
+ // calls ensureInitialized().
1222
1223
  this.vault = new Vault(this)
1223
1224
  if (this.homedir) {
1224
- this.vault.ready = this.vault.init({ existingOnly: true }).then(async (result) => {
1225
- if (result && result.enabled && this.vault.initialized) {
1226
- this.vault.verificationPending = true
1227
- await this.vault.runExclusive(async () => {
1228
- await this.vault.verify()
1229
- await this.vault.registry.flush()
1230
- })
1231
- this.vault.verificationPending = false
1232
- }
1233
- return result
1234
- }).catch((err) => {
1225
+ this.vault.ready = this.vault.init({ deferStorage: true }).catch((err) => {
1235
1226
  // Keep an enabled Vault retryable after transient registry or
1236
1227
  // filesystem errors. A genuinely disabled Vault already has
1237
1228
  // enabled=false from its environment check.
@@ -1,16 +1,18 @@
1
1
  const CANDIDATE_SIZE_BASE = process.platform === "win32" ? 1024 : 1000
2
- const CANDIDATE_SIZE_OPTIONS = [1, 10, 50, 100, 500]
3
- .map((value) => value * CANDIDATE_SIZE_BASE ** 2)
2
+ const SIZE_THRESHOLD = 100 * CANDIDATE_SIZE_BASE ** 2
3
+ const CANDIDATE_SIZE_OPTIONS = [0]
4
+ .concat([1, 10, 50, 100, 500].map((value) => value * CANDIDATE_SIZE_BASE ** 2))
4
5
  .concat(CANDIDATE_SIZE_BASE ** 3)
6
+ const isCandidateFileSize = (size, threshold) => size > 0 && size >= threshold
5
7
 
6
8
  module.exports = {
7
- SIZE_THRESHOLD: CANDIDATE_SIZE_OPTIONS[3],
9
+ SIZE_THRESHOLD,
8
10
  CANDIDATE_SIZE_OPTIONS,
11
+ isCandidateFileSize,
9
12
  TMP_SUFFIX: ".pinokio-dedup-tmp",
10
13
  SHA256_RE: /^[0-9a-f]{64}$/,
11
14
  ENTRY_BATCH_SIZE: 256,
12
15
  DIR_CONCURRENCY: 8,
13
16
  STAT_CONCURRENCY: 32,
14
- HASH_QUEUE_LIMIT: 256,
15
17
  HASH_INACTIVITY_MS: 120 * 1000
16
18
  }