Skip to content

Commit

Permalink
check task finished before timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lnfjpt committed Dec 26, 2024
1 parent a9a865b commit 4dcca30
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ impl<D: Data, T: Debug + Send + 'static> Task for Worker<D, T> {

fn check_ready(&mut self) -> TaskState {
let _g = crate::worker_id::guard(self.id);
if self.is_finished && self.peer_guard.load(Ordering::SeqCst) == 0 {
return TaskState::Finished;
}
if self.check_cancel() {
self.sink.set_cancel_hook(true);
return TaskState::Finished;
Expand Down

0 comments on commit 4dcca30

Please sign in to comment.