From 3bfec00c84942adaeadbf505139d8f7fd7c1b877 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 f0508cff..aafdfc3f 100644 --- a/common/src/tap_manager.rs +++ b/common/src/tap_manager.rs @@ -24,7 +24,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 { @@ -51,8 +51,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, @@ -172,7 +171,7 @@ impl TapManager { pgpool: PgPool, mut pglistener: PgListener, denylist: Arc>>, - cancel_token: Arc, + cancel_token: tokio_util::sync::CancellationToken, ) { #[derive(serde::Deserialize)] struct DenylistNotification {