summaryrefslogtreecommitdiff
path: root/src/chunker/rw/storage/write/simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunker/rw/storage/write/simple.rs')
-rw-r--r--src/chunker/rw/storage/write/simple.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/chunker/rw/storage/write/simple.rs b/src/chunker/rw/storage/write/simple.rs
index 38aecfc..461afff 100644
--- a/src/chunker/rw/storage/write/simple.rs
+++ b/src/chunker/rw/storage/write/simple.rs
@@ -87,16 +87,20 @@ async fn write_file_to_storage(
trace!("file_size={}", raw_data.len());
trace!("output_index_file={}", output_index_file.display());
trace!("policy_name={:?}", ctx.policy_name);
- trace!("storage_dir={}", ctx.output_dir.display());
+ trace!(
+ "storage_dir={}",
+ ctx.storage_path.as_ref().unwrap().display()
+ );
info!(
"{} chunks will be written to {}",
chunk_count,
- ctx.output_dir.display()
+ ctx.storage_path.as_ref().unwrap().display()
);
- tokio::fs::create_dir_all(&ctx.output_dir).await?;
- trace!("Output directory created or already exists");
+ let storage_dir = ctx.storage_path.as_ref().unwrap().clone();
+ tokio::fs::create_dir_all(&storage_dir).await?;
+ trace!("Storage directory created or already exists");
let mut tasks = Vec::new();
let mut start = 0;
@@ -119,7 +123,7 @@ async fn write_file_to_storage(
progress_name: progress_name.clone(),
step,
chunk_data: chunk_data.to_vec(),
- output_dir: ctx.output_dir.clone(),
+ output_dir: ctx.storage_path.as_ref().unwrap().clone(),
chunk_hash: ctx.chunk_hash,
chunk_index,
};
@@ -149,7 +153,7 @@ async fn write_file_to_storage(
progress_name: progress_name.clone(),
step,
chunk_data: chunk_data.to_vec(),
- output_dir: ctx.output_dir.clone(),
+ output_dir: ctx.storage_path.as_ref().unwrap().clone(),
chunk_hash: ctx.chunk_hash,
chunk_index,
};