Skip to content
Snippets Groups Projects
Commit 5ae008dc authored by Éloïs's avatar Éloïs
Browse files

fix(indexer): create blocks_chunks folder if is not exist

parent caf7b4c6
No related branches found
No related tags found
No related merge requests found
Pipeline #12471 passed
......@@ -83,6 +83,9 @@ fn write_and_compress_chunk_in_file(
chunks_folder_path: &Path,
) -> Result<(), std::io::Error> {
log::info!("blocks_chunk_{}: {} bytes", chunk_index, chunk.len());
if !chunks_folder_path.exists() {
std::fs::create_dir(chunks_folder_path)?;
}
let file = std::fs::File::create(chunks_folder_path.join(format!("_{}", chunk_index)))?;
let mut e = ZlibEncoder::new(file, Compression::new(3));
e.write_all(chunk)?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment