From fbaf97e7a921a1604210456b4120f51361e02002 Mon Sep 17 00:00:00 2001 From: Alexis Asseman Date: Mon, 15 Jan 2024 10:16:14 -0800 Subject: [PATCH] refactor: remove unnecessary Arc on CancellationToken Signed-off-by: Alexis Asseman --- common/src/tap_manager.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/tap_manager.rs b/common/src/tap_manager.rs index 02aab736..6194b8ac 100644 --- a/common/src/tap_manager.rs +++ b/common/src/tap_manager.rs @@ -23,7 +23,7 @@ pub struct TapManager { domain_separator: Arc, sender_denylist: Arc>>, _sender_denylist_watcher_handle: Arc>, - sender_denylist_watcher_cancel_token: Arc, + sender_denylist_watcher_cancel_token: tokio_util::sync::CancellationToken, } impl TapManager { @@ -50,8 +50,7 @@ impl TapManager { .await .expect("should be able to fetch the sender_denylist from the DB on startup"); - let sender_denylist_watcher_cancel_token = - Arc::new(tokio_util::sync::CancellationToken::new()); + let sender_denylist_watcher_cancel_token = tokio_util::sync::CancellationToken::new(); let sender_denylist_watcher_handle = Arc::new(tokio::spawn(Self::sender_denylist_watcher( pgpool.clone(), pglistener, @@ -174,7 +173,7 @@ impl TapManager { pgpool: PgPool, mut pglistener: PgListener, denylist: Arc>>, - cancel_token: Arc, + cancel_token: tokio_util::sync::CancellationToken, ) { #[derive(serde::Deserialize)] struct DenylistNotification {