mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-02 03:45:12 -04:00
fix: install more packages without panics (#111)
This commit is contained in:
@@ -53,7 +53,7 @@ async fn internal_fetch(
|
||||
let cas_paths = download_tarball_to_store(
|
||||
tarball_cache,
|
||||
&config.store_dir,
|
||||
&package_version.dist.integrity,
|
||||
package_version.dist.integrity.as_ref().expect("has integrity field"),
|
||||
package_version.dist.unpacked_size,
|
||||
package_version.as_tarball_url(),
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Serialize, Deserialize, Debug, Default, Clone, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PackageDistribution {
|
||||
pub integrity: String,
|
||||
pub shasum: String,
|
||||
pub integrity: Option<String>,
|
||||
pub shasum: Option<String>,
|
||||
pub tarball: String,
|
||||
pub file_count: Option<usize>,
|
||||
pub unpacked_size: Option<usize>,
|
||||
|
||||
@@ -165,7 +165,7 @@ pub async fn download_tarball_to_store(
|
||||
error,
|
||||
})?;
|
||||
let url = package_url.to_string(); // TODO: use Arc
|
||||
let cas_paths = tokio::task::spawn_blocking(move || {
|
||||
let cas_paths = tokio::task::spawn(async move {
|
||||
verify_checksum(&response, package_integrity)
|
||||
.map_err(|error| VerifyChecksumError { url, error })?;
|
||||
let data = decompress_gzip(&response, package_unpacked_size)?;
|
||||
|
||||
Reference in New Issue
Block a user