aboutsummaryrefslogtreecommitdiff
path: root/src/util/background/job_worker.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-21 13:50:55 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-21 13:50:55 +0200
commit3119ea59b08e62ce14cddeb4809a397785b662bb (patch)
tree08e54b210ba73988ed1ac56db7045f39f3791bdb /src/util/background/job_worker.rs
parente12bc3b5959c0aa5ae3c8a746c62bab2e7343a62 (diff)
downloadgarage-3119ea59b08e62ce14cddeb4809a397785b662bb.tar.gz
garage-3119ea59b08e62ce14cddeb4809a397785b662bb.zip
New worker semantics applied to garage_table
Diffstat (limited to 'src/util/background/job_worker.rs')
-rw-r--r--src/util/background/job_worker.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/util/background/job_worker.rs b/src/util/background/job_worker.rs
index 8cc660f8..fcdac582 100644
--- a/src/util/background/job_worker.rs
+++ b/src/util/background/job_worker.rs
@@ -34,16 +34,15 @@ impl Worker for JobWorker {
}
}
- async fn wait_for_work(&mut self, must_exit: &mut watch::Receiver<bool>) -> WorkerStatus {
+ async fn wait_for_work(&mut self, must_exit: &watch::Receiver<bool>) -> WorkerStatus {
loop {
match self.job_chan.lock().await.recv().await {
Some((job, cancellable)) => {
if cancellable && *must_exit.borrow() {
- // skip job
continue;
}
self.next_job = Some(job);
- return WorkerStatus::Busy
+ return WorkerStatus::Busy;
}
None => return WorkerStatus::Done,
}