Skip to content

Commit

Permalink
refactor: remove unnecessary Arc on CancellationToken
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
  • Loading branch information
aasseman committed Jan 17, 2024
1 parent 5713562 commit 3bfec00
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions common/src/tap_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct TapManager {
domain_separator: Arc<Eip712Domain>,
sender_denylist: Arc<RwLock<HashSet<Address>>>,
_sender_denylist_watcher_handle: Arc<tokio::task::JoinHandle<()>>,
sender_denylist_watcher_cancel_token: Arc<tokio_util::sync::CancellationToken>,
sender_denylist_watcher_cancel_token: tokio_util::sync::CancellationToken,
}

impl TapManager {
Expand All @@ -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,
Expand Down Expand Up @@ -172,7 +171,7 @@ impl TapManager {
pgpool: PgPool,
mut pglistener: PgListener,
denylist: Arc<RwLock<HashSet<Address>>>,
cancel_token: Arc<tokio_util::sync::CancellationToken>,
cancel_token: tokio_util::sync::CancellationToken,
) {
#[derive(serde::Deserialize)]
struct DenylistNotification {
Expand Down

0 comments on commit 3bfec00

Please sign in to comment.