Skip to content

Commit

Permalink
Perform parallel reading of content directory to speed up startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisstaite-menlo committed Jun 25, 2023
1 parent 68b65d5 commit dd89850
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cas/store/filesystem_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ async fn add_files_to_cache(

let read_dir_stream = ReadDirStream::new(dir_handle);
read_dir_stream
.then(|dir_entry| async move {
.map(|dir_entry| async move {
let dir_entry = dir_entry.unwrap();
let file_name = dir_entry.file_name().into_string().unwrap();
let metadata = dir_entry
Expand All @@ -263,6 +263,7 @@ async fn add_files_to_cache(
};
Result::<(String, SystemTime, u64), Error>::Ok((file_name, atime, metadata.len()))
})
.buffer_unordered(200)
.try_collect()
.await?
};
Expand Down

0 comments on commit dd89850

Please sign in to comment.