Skip to content

Commit

Permalink
Send telemetry report to quickinstall if no pre-built is found
Browse files Browse the repository at this point in the history
quickinstall telemtry is overloaded cargo-bins/cargo-quickinstall#268, it only needs report when the pre-built is not available in upstream.

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu authored Sep 5, 2024
1 parent e4bbbff commit 7d2c95c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions crates/binstalk/src/ops/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,7 @@ async fn resolve_inner(
);
}

if !opts.disable_telemetry {
for fetcher in &handles {
fetcher.clone().report_to_upstream();
}
}

for fetcher in handles {
for fetcher in &handles {
match timeout(
opts.maximum_resolution_timeout,
AutoAbortJoinHandle::new(fetcher.clone().find()).flattened_join(),
Expand Down Expand Up @@ -210,7 +204,7 @@ async fn resolve_inner(
Ok(bin_files) => {
if !bin_files.is_empty() {
return Ok(Resolution::Fetch(Box::new(ResolutionFetch {
fetcher,
fetcher.clone(),
new_version: package_info.version,
name: package_info.name,
version_req: version_req_str,
Expand Down Expand Up @@ -256,6 +250,13 @@ async fn resolve_inner(
}
}

if !opts.disable_telemetry {
for fetcher in &handles {
fetcher.clone().report_to_upstream();
}
}


if !opts.cargo_install_fallback {
return Err(BinstallError::NoFallbackToCargoInstall);
}
Expand Down

0 comments on commit 7d2c95c

Please sign in to comment.