diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-31 16:53:33 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-03 18:54:51 +0100 |
commit | d405a9f839779b1454e47e4b53a418603061c5e9 (patch) | |
tree | 78f35706e31e6dd3cd4ae42ca73d757fd6655d7d /src/api/admin/worker.rs | |
parent | 7b9c047b113d78dacbece4670b8a1a1cbd771849 (diff) | |
download | garage-d405a9f839779b1454e47e4b53a418603061c5e9.tar.gz garage-d405a9f839779b1454e47e4b53a418603061c5e9.zip |
cli_v2: implement ListBlockErrors and GetBlockInfo
Diffstat (limited to 'src/api/admin/worker.rs')
-rw-r--r-- | src/api/admin/worker.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/admin/worker.rs b/src/api/admin/worker.rs index c7c75700..d143e5be 100644 --- a/src/api/admin/worker.rs +++ b/src/api/admin/worker.rs @@ -100,7 +100,7 @@ impl RequestHandler for LocalSetWorkerVariableRequest { fn worker_info_to_api(id: u64, info: WorkerInfo) -> WorkerInfoResp { WorkerInfoResp { - id: id, + id, name: info.name, state: match info.state { WorkerState::Busy => WorkerStateResp::Busy, @@ -112,7 +112,7 @@ fn worker_info_to_api(id: u64, info: WorkerInfo) -> WorkerInfoResp { consecutive_errors: info.consecutive_errors as u64, last_error: info.last_error.map(|(message, t)| WorkerLastError { message, - secs_ago: (std::cmp::max(t, now_msec()) - t) / 1000, + secs_ago: now_msec().saturating_sub(t) / 1000, }), tranquility: info.status.tranquility, |