Skip to content

Commit

Permalink
fix: console gzip
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Aug 17, 2024
1 parent 5270b49 commit 87ee1b5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions src/console/src/storage/strategy_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,17 @@ impl StorageUploadStrategy for StorageUpload {

fn get_asset(
&self,
reference_id: &ReferenceId,
reference_id: &Option<ReferenceId>,
collection: &CollectionKey,
full_path: &FullPath,
_rule: &Rule,
) -> Option<Asset> {
let asset = get_asset_stable(reference_id, collection, full_path);

match asset {
Some(asset) => Some(asset),
None => get_asset(full_path),
) -> Result<Option<Asset>, String> {
match reference_id {
Some(reference_id) => {
let asset = get_asset_stable(reference_id, collection, full_path);
Ok(asset)
}
None => Err("Cannot get asset with unknown reference / proposal ID.".to_string()),
}
}
}
7 changes: 4 additions & 3 deletions src/libs/satellite/src/storage/strategy_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ impl StorageUploadStrategy for StorageUpload {

fn get_asset(
&self,
_reference_id: &ReferenceId,
_reference_id: &Option<ReferenceId>,
collection: &CollectionKey,
full_path: &FullPath,
rule: &Rule,
) -> Option<Asset> {
get_asset(collection, full_path, rule)
) -> Result<Option<Asset>, String> {
let asset = get_asset(collection, full_path, rule);
Ok(asset)
}
}
4 changes: 2 additions & 2 deletions src/libs/storage/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ fn secure_commit_chunks(
let rule = storage_state.get_rule(&batch.key.collection)?;

let current = storage_upload.get_asset(
&commit_batch.batch_id,
&batch.reference_id,
&batch.key.collection,
&batch.key.full_path,
&rule,
);
)?;

match current {
None => {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/storage/src/strategies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ pub trait StorageUploadStrategy {

fn get_asset(
&self,
reference_id: &ReferenceId,
reference_id: &Option<ReferenceId>,
collection: &CollectionKey,
full_path: &FullPath,
rule: &Rule,
) -> Option<Asset>;
) -> Result<Option<Asset>, String>;
}

0 comments on commit 87ee1b5

Please sign in to comment.