Skip to content

Commit

Permalink
explicitly abort heartbeat task
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Nov 13, 2024
1 parent ff1ff33 commit 4c2bec5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,10 @@ impl<T: Task + Sync> Worker<T> {
let retry_policy = &in_progress_task.retry_policy;
self.handle_task_timeout(&mut tx, &in_progress_task, retry_policy, timeout).await?;
}

// Select the heartbeat task so that it'll be cancelled after execution or timeout.
_ = heartbeat_task => {
tracing::error!("Heartbeat task failed unexpectedly (this is a critical error!)");
}

}

heartbeat_task.abort();

tx.commit().await?;

Ok(Some(task_id))
Expand Down

0 comments on commit 4c2bec5

Please sign in to comment.