Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Dec 22, 2024
1 parent 7998a1b commit 6668605
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/node/da_dispatcher/src/da_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl DataAvailabilityDispatcher {
let self_arc = Arc::new(self.clone());

let mut stop_receiver_dispatch = stop_receiver.clone();
let mut stop_receiver_poll_for_inclusion = stop_receiver.clone();

let dispatch_task = tokio::spawn(async move {
loop {
Expand All @@ -63,17 +64,20 @@ impl DataAvailabilityDispatcher {

let inclusion_task = tokio::spawn(async move {
loop {
if *stop_receiver.borrow() {
if *stop_receiver_poll_for_inclusion.borrow() {
break;
}

if let Err(err) = self.poll_for_inclusion().await {
tracing::error!("poll_for_inclusion error {err:?}");
}

if tokio::time::timeout(self.config.polling_interval(), stop_receiver.changed())
.await
.is_ok()
if tokio::time::timeout(
self.config.polling_interval(),
stop_receiver_poll_for_inclusion.changed(),
)
.await
.is_ok()
{
break;
}
Expand Down

0 comments on commit 6668605

Please sign in to comment.