aboutsummaryrefslogtreecommitdiff
path: root/src/util/background/worker.rs
diff options
context:
space:
mode:
authorAlex Auvolat <lx@deuxfleurs.fr>2025-01-31 15:39:31 +0100
committerAlex Auvolat <lx@deuxfleurs.fr>2025-02-03 18:54:51 +0100
commit10bbb26b303e7bd58ca3396009a66b70a1673c0f (patch)
tree82b718338b1f6e2693d1345ca872bc2fbb652dcb /src/util/background/worker.rs
parent89ff9f5576f91dc127ba3cc1fae96543e27b9468 (diff)
downloadgarage-10bbb26b303e7bd58ca3396009a66b70a1673c0f.tar.gz
garage-10bbb26b303e7bd58ca3396009a66b70a1673c0f.zip
cli_v2: implement ListWorkers and GetWorkerInfo
Diffstat (limited to 'src/util/background/worker.rs')
-rw-r--r--src/util/background/worker.rs14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/util/background/worker.rs b/src/util/background/worker.rs
index 76fb14e8..9028a052 100644
--- a/src/util/background/worker.rs
+++ b/src/util/background/worker.rs
@@ -6,7 +6,6 @@ use async_trait::async_trait;
use futures::future::*;
use futures::stream::FuturesUnordered;
use futures::StreamExt;
-use serde::{Deserialize, Serialize};
use tokio::select;
use tokio::sync::{mpsc, watch};
@@ -18,7 +17,7 @@ use crate::time::now_msec;
// will be interrupted in the middle of whatever they are doing.
const EXIT_DEADLINE: Duration = Duration::from_secs(8);
-#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)]
+#[derive(PartialEq, Copy, Clone, Debug)]
pub enum WorkerState {
Busy,
Throttled(f32),
@@ -26,17 +25,6 @@ pub enum WorkerState {
Done,
}
-impl std::fmt::Display for WorkerState {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- match self {
- WorkerState::Busy => write!(f, "Busy"),
- WorkerState::Throttled(_) => write!(f, "Busy*"),
- WorkerState::Idle => write!(f, "Idle"),
- WorkerState::Done => write!(f, "Done"),
- }
- }
-}
-
#[async_trait]
pub trait Worker: Send {
fn name(&self) -> String;