Content-Length: 210797 | pFad | https://github.com/pnpm/pacquet/commit/92d59495d5fd165f10698c61add7cd39b8fe214f

12 perf: use tokio tasks · pnpm/pacquet@92d5949 · GitHub
Skip to content

Commit

Permalink
perf: use tokio tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Nov 6, 2023
1 parent 8c38feb commit 92d5949
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/tarball/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ impl<'a> DownloadTarballToStore<'a> {

Ok::<_, TarballError>(((cleaned_entry_path, file_path), (index_key, index_value)))
})
.map(tokio::task::spawn)
.pipe(futures_util::future::join_all)
.await;

let mut cas_paths = HashMap::<OsString, PathBuf>::with_capacity(entries.len());
let mut pkg_files_idx = PackageFilesIndex { files: HashMap::with_capacity(entries.len()) };
for entry in entries {
let ((cleaned_entry_path, file_path), (index_key, index_value)) = entry?;
let ((cleaned_entry_path, file_path), (index_key, index_value)) =
entry.expect("no join error")?;

if let Some(previous) = cas_paths.insert(cleaned_entry_path, file_path) {
tracing::warn!(?previous, "Duplication detected. Old entry has been ejected");
Expand Down

0 comments on commit 92d5949

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/pnpm/pacquet/commit/92d59495d5fd165f10698c61add7cd39b8fe214f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy