report to new stats server (with status) (#1912)

* docstrings for things that I was curious about

* report to new stats server, with status

* Arc<Self> needs a clone

* fix stats url in docs

* fix stats url handling
This commit is contained in:
David Laban 2024-09-11 09:15:15 +01:00 committed by GitHub
parent a88335d05b
commit c8dec953cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 71 additions and 11 deletions

View file

@ -10,4 +10,4 @@ pub use binstalk_registry as registry;
pub use binstalk_types as manifests;
pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET};
pub use fetchers::QUICK_INSTALL_STATS_URL;
pub use fetchers::QUICKINSTALL_STATS_URL;

View file

@ -203,6 +203,7 @@ async fn resolve_inner(
{
Ok(bin_files) => {
if !bin_files.is_empty() {
fetcher.clone().report_to_upstream();
return Ok(Resolution::Fetch(Box::new(ResolutionFetch {
fetcher: fetcher.clone(),
new_version: package_info.version,
@ -250,6 +251,8 @@ async fn resolve_inner(
}
}
// At this point, we don't know whether fallback to cargo install is allowed, or whether it will
// succeed, but things start to get convoluted when try to include that data, so this will do.
if !opts.disable_telemetry {
for fetcher in handles {
fetcher.report_to_upstream();