From ed0ea7f632d1dc6979adbd1289a78b437e815a96 Mon Sep 17 00:00:00 2001 From: haoliang <821644@qq.com> Date: Sun, 3 May 2026 02:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E9=9B=86=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=EF=BC=9A=E7=94=A8?= =?UTF-8?q?=E5=BF=83=E8=B7=B3status=E5=AD=97=E6=AE=B5=E6=9B=BF=E4=BB=A3?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=A8=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CncService/Impl/DashboardService.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/CncService/Impl/DashboardService.cs b/src/CncService/Impl/DashboardService.cs index 78e346f..9258443 100644 --- a/src/CncService/Impl/DashboardService.cs +++ b/src/CncService/Impl/DashboardService.cs @@ -73,13 +73,8 @@ namespace CncService.Impl public object GetCollectorStatus() { var latest = _collectorHeartbeatRepository.GetLatest("collector-service"); - bool isRunning = latest != null && latest.LastCollectTime.HasValue && - (DateTime.Now - latest.LastCollectTime.Value).TotalMinutes < 5; - long uptimeSeconds = 0; - if (isRunning && latest != null) - { - uptimeSeconds = latest.UptimeSeconds ?? 0; - } + bool isRunning = latest != null && latest.Status == "running"; + long uptimeSeconds = isRunning ? (latest.UptimeSeconds ?? 0) : 0; return new { status = isRunning ? "running" : "stopped", uptimeSeconds, lastCollectTime = latest?.LastCollectTime }; } }