fix(app): remove redundant Arc wrapper around PrometheusHandle
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions

Actix-web's Data<T> extractor expects T to implement Clone,
so PrometheusHandle (which is Clone) does not need to be
wrapped in Arc. The Arc type mismatch caused /metrics to
return 500.
This commit is contained in:
ZhenYi 2026-04-25 21:09:32 +08:00
parent 90447ef98f
commit 91bebba45e

View File

@ -86,8 +86,7 @@ async fn main() -> anyhow::Result<()> {
};
let prometheus_handle = install_recorder();
let prometheus_handle_arc = std::sync::Arc::new(prometheus_handle);
let prometheus_handle_data = web::Data::new(prometheus_handle_arc.clone());
let prometheus_handle_data = web::Data::new(prometheus_handle.clone());
let http_metrics = std::sync::Arc::new(HttpMetrics::new());
let http_snapshot: HttpSnapshotGuard = std::sync::Arc::new(std::sync::RwLock::new(