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 <[email protected]>
  • Loading branch information
aasseman committed Jan 15, 2024
1 parent 6f263c5 commit fbaf97e
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 @@ -23,7 +23,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 @@ -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,
Expand Down Expand Up @@ -174,7 +173,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 fbaf97e

Please sign in to comment.