Remove unnecessary Arc around tokio::watch::Sender

This commit is contained in:
harry007
2025-04-24 12:02:11 +02:00
committed by GitHub
parent de02baeac3
commit 1599569df2
3 changed files with 7 additions and 9 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ serde_json = { version = "1.0", features = ["raw_value"], optional = true }
serde_path_to_error = { version = "0.1.8", optional = true }
serde_urlencoded = { version = "0.7", optional = true }
sha1 = { version = "0.10", optional = true }
tokio = { package = "tokio", version = "1.25.0", features = ["time"], optional = true }
tokio = { package = "tokio", version = "1.44", features = ["time"], optional = true }
tokio-tungstenite = { version = "0.26.0", optional = true }
tracing = { version = "0.1", default-features = false, optional = true }
@@ -131,7 +131,7 @@ reqwest = { version = "0.12", default-features = false, features = ["json", "str
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
time = { version = "0.3", features = ["serde-human-readable"] }
tokio = { package = "tokio", version = "1.25.0", features = ["macros", "rt", "rt-multi-thread", "net", "test-util"] }
tokio = { package = "tokio", version = "1.44.2", features = ["macros", "rt", "rt-multi-thread", "net", "test-util"] }
tokio-stream = "0.1"
tokio-tungstenite = "0.26.0"
tracing = "0.1"
+1 -3
View File
@@ -6,7 +6,6 @@ use std::{
future::{poll_fn, Future, IntoFuture},
io,
marker::PhantomData,
sync::Arc,
};
use axum_core::{body::Body, extract::Request, response::Response};
@@ -293,7 +292,6 @@ where
} = self;
let (signal_tx, signal_rx) = watch::channel(());
let signal_tx = Arc::new(signal_tx);
tokio::spawn(async move {
signal.await;
trace!("received graceful shutdown signal. Telling tasks to shutdown");
@@ -330,7 +328,7 @@ where
let hyper_service = TowerToHyperService::new(tower_service);
let signal_tx = Arc::clone(&signal_tx);
let signal_tx = signal_tx.clone();
let close_rx = close_rx.clone();