Simplified and more aggressive worker exit logic

This commit is contained in:
Alex Auvolat
2022-12-14 15:25:29 +01:00
parent d4af27f920
commit dfc131850a
8 changed files with 32 additions and 71 deletions
+1 -4
View File
@@ -348,10 +348,7 @@ where
}
}
async fn wait_for_work(&mut self, must_exit: &watch::Receiver<bool>) -> WorkerState {
if *must_exit.borrow() {
return WorkerState::Done;
}
async fn wait_for_work(&mut self) -> WorkerState {
tokio::time::sleep(self.wait_delay).await;
WorkerState::Busy
}