pinokiod 8.0.51 → 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 +4 -13
- package/kernel/vault/constants.js +6 -4
- package/kernel/vault/index.js +2367 -1743
- package/kernel/vault/registry.js +117 -500
- package/kernel/vault/registry_core.js +3387 -0
- package/kernel/vault/registry_worker.js +25 -0
- package/kernel/vault/snapshot.js +11 -4
- package/kernel/vault/sweeper.js +579 -572
- package/kernel/vault/walker.js +34 -15
- package/package.json +2 -1
- package/server/index.js +32 -5
- package/server/public/vault.css +251 -80
- package/server/public/vault.js +1329 -574
- package/server/views/partials/vault_workspace.ejs +19 -25
- package/test/vault-engine.test.js +749 -1581
- package/test/vault-sweep.test.js +1347 -1044
- package/test/vault-ui.test.js +883 -2701
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:
|
|
1221
|
-
//
|
|
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({
|
|
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
|
|
3
|
-
|
|
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
|
|
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
|
}
|