From 5c01008d8a580c262ae964c0abeeea5fabf26b37 Mon Sep 17 00:00:00 2001 From: break Date: Tue, 11 Aug 2026 09:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/service/polling/concurrency_service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/service/polling/concurrency_service.go b/internal/service/polling/concurrency_service.go index 45c4ef2..83037ab 100644 --- a/internal/service/polling/concurrency_service.go +++ b/internal/service/polling/concurrency_service.go @@ -2,6 +2,7 @@ package polling import ( "context" + "math" "strings" "time" @@ -79,7 +80,7 @@ func (s *ConcurrencyService) List(ctx context.Context) ([]*ConcurrencyStatus, er status.Available = 0 } if cfg.MaxConcurrency > 0 { - status.Utilization = float64(current) / float64(cfg.MaxConcurrency) * 100 + status.Utilization = math.Round(float64(current)/float64(cfg.MaxConcurrency)*1000000) / 100 } result = append(result, status) @@ -117,7 +118,7 @@ func (s *ConcurrencyService) GetByTaskType(ctx context.Context, taskType string) status.Available = 0 } if cfg.MaxConcurrency > 0 { - status.Utilization = float64(current) / float64(cfg.MaxConcurrency) * 100 + status.Utilization = math.Round(float64(current)/float64(cfg.MaxConcurrency)*1000000) / 100 } return status, nil