From bf03afafc0c70d7d24eccff05fa833d868b7525d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zapletal?= Date: Mon, 16 Oct 2023 11:09:33 +0200 Subject: [PATCH] chore: fix stats logging --- internal/background/db_stats.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/background/db_stats.go b/internal/background/db_stats.go index 8e0ae37f..556686be 100644 --- a/internal/background/db_stats.go +++ b/internal/background/db_stats.go @@ -51,16 +51,16 @@ func dbStatsTick(ctx context.Context) error { return fmt.Errorf("stats error: %w", err) } - success, failure, pending := 0, 0, 0 + var success, failure, pending int64 for _, s := range stats.Usage24h { if s.Result == "success" { - success += 1 + success += s.Count } if s.Result == "failure" { - failure += 1 + failure += s.Count } if s.Result == "pending" { - pending += 1 + pending += s.Count } metrics.SetReservations24hCount(s.Result, s.Provider, s.Count) }