Skip to content

Commit

Permalink
fix: race condition on upload and use encodings in hash tree (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Nov 10, 2023
1 parent 31e46cd commit 63c591b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/satellite/src/storage/certification/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl CertifiedAssetHashes {
pub fn insert(&mut self, asset: &Asset, config: &StorageConfig) {
let full_path = asset.key.full_path.clone();

for encoding_type in ENCODING_CERTIFICATION_ORDER.iter() {
for encoding_type in ENCODING_CERTIFICATION_ORDER.iter().rev() {
if let Some(encoding) = asset.encodings.get(*encoding_type) {
self.insert_v1(&full_path, encoding.sha256);
self.insert_v2(
Expand Down Expand Up @@ -213,7 +213,7 @@ impl CertifiedAssetHashes {
asset: &Asset,
config: &StorageConfig,
) {
for encoding_type in ENCODING_CERTIFICATION_ORDER.iter() {
for encoding_type in ENCODING_CERTIFICATION_ORDER.iter().rev() {
if let Some(encoding) = asset.encodings.get(*encoding_type) {
self.insert_rewrite_into_tree_v2(
full_path,
Expand Down

0 comments on commit 63c591b

Please sign in to comment.