feat(xo-server-audit/_uploadLastHash): check integrity sequentially (#5250)
- implementation is simpler - stop on first error
This commit is contained in:
parent
14ab694804
commit
8a98b6b012
@ -35,5 +35,6 @@
|
|||||||
>
|
>
|
||||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
||||||
|
|
||||||
|
- xo-server-audit patch
|
||||||
- xo-vmdk-to-vhd patch
|
- xo-vmdk-to-vhd patch
|
||||||
- xo-web minor
|
- xo-web minor
|
||||||
|
@ -335,16 +335,18 @@ class AuditXoPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check the integrity of all stored hashes
|
// check the integrity of all stored hashes
|
||||||
integrityCheckSuccess = await Promise.all(
|
try {
|
||||||
hashes.map((oldest, key) =>
|
for (let i = 0; i < hashes.length - 1; ++i) {
|
||||||
oldest !== lastHash
|
await this._checkIntegrity({
|
||||||
? this._checkIntegrity({ oldest, newest: hashes[key + 1] })
|
oldest: hashes[i],
|
||||||
: true
|
newest: hashes[i + 1],
|
||||||
)
|
})
|
||||||
).then(
|
}
|
||||||
() => true,
|
|
||||||
() => false
|
integrityCheckSuccess = true
|
||||||
)
|
} catch (_) {
|
||||||
|
integrityCheckSuccess = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate a valid fingerprint of all stored records in case of a failure integrity check
|
// generate a valid fingerprint of all stored records in case of a failure integrity check
|
||||||
|
Loading…
Reference in New Issue
Block a user