From 91bebba45e9cb272066515c73c0ae8dca0624f1a Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Sat, 25 Apr 2026 21:09:32 +0800 Subject: [PATCH] fix(app): remove redundant Arc wrapper around PrometheusHandle Actix-web's Data 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. --- apps/app/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index a3c88ce..9709556 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -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(