From 13678b31a028b060eb40c2a3e0d91744336beb89 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Sat, 23 Mar 2024 21:48:42 +0800 Subject: [PATCH] fix: fix dashboard stats for noarch jobs --- server/src/routes/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/routes/mod.rs b/server/src/routes/mod.rs index e94c814..0ca46f4 100644 --- a/server/src/routes/mod.rs +++ b/server/src/routes/mod.rs @@ -171,7 +171,7 @@ pub async fn dashboard_status( } else { arch }; - by_arch.entry(arch).or_default().total_job_count = count; + by_arch.entry(arch).or_default().total_job_count += count; } for (arch, count) in crate::schema::jobs::dsl::jobs @@ -188,7 +188,7 @@ pub async fn dashboard_status( } else { arch }; - by_arch.entry(arch).or_default().pending_job_count = count; + by_arch.entry(arch).or_default().pending_job_count += count; } for (arch, count) in crate::schema::jobs::dsl::jobs @@ -205,7 +205,7 @@ pub async fn dashboard_status( } else { arch }; - by_arch.entry(arch).or_default().running_job_count = count; + by_arch.entry(arch).or_default().running_job_count += count; } Ok(DashboardStatusResponse {