From 6ef35ded69891d2ca1dc9535dfc29afdae1e3770 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 23 Jun 2023 08:52:19 -0400 Subject: [PATCH] Accept diagnostics as an argument, even though it doesn't do anything --- magic-nix-cache/src/main.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/magic-nix-cache/src/main.rs b/magic-nix-cache/src/main.rs index eeca136..9b215fa 100644 --- a/magic-nix-cache/src/main.rs +++ b/magic-nix-cache/src/main.rs @@ -68,6 +68,16 @@ struct Args { #[arg(long)] upstream: Option, + /// Diagnostic endpoint to send diagnostics and performance data. + /// + /// Set it to an empty string to disable reporting. + /// See the README for details. + #[arg( + long, + default_value = "https://install.determinate.systems/nix-actions-cache/perf" + )] + diagnostic_endpoint: String, + /// Daemonize the server. /// /// This is for use in the GitHub Action only. @@ -115,6 +125,15 @@ fn main() { .expect("Failed to load credentials from environment (see README.md)") }; + match args.diagnostic_endpoint.as_str() { + "" => { + tracing::info!("Diagnostics disabled."); + } + url => { + tracing::info!("Diagnostics would report to {url}, but is currently unimplemented."); + } + } + let mut api = Api::new(credentials).expect("Failed to initialize GitHub Actions Cache API"); if let Some(cache_version) = &args.cache_version {