From 6c220602fd103bd350d37609503b4d55502292e6 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 11 Jan 2022 16:01:51 +0100 Subject: [PATCH] Improved code. --- src/fr/devinsy/statoolinfos/core/Service.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 065f857..f5d48f4 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -489,7 +489,8 @@ public class Service extends PathPropertyList MonthValues values = getMetricMonthValues("metrics.service.users"); - values = values.extract(YearMonth.now().minusMonths(1), YearMonth.now().minusMonths(1)); + YearMonth previousMonth = YearMonth.now().minusMonths(1); + values = values.extract(previousMonth, previousMonth); result = (long) values.sum();