From 96941b33ea231e4a73ee7fa8f3e7a403ea3b9408 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Tue, 17 Dec 2024 17:01:45 -0300 Subject: [PATCH] Fix wrong stats for total apps failed metric --- .../meteor/app/statistics/server/lib/getAppsStatistics.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/meteor/app/statistics/server/lib/getAppsStatistics.ts b/apps/meteor/app/statistics/server/lib/getAppsStatistics.ts index 40c8e1946e36..90e05d192356 100644 --- a/apps/meteor/app/statistics/server/lib/getAppsStatistics.ts +++ b/apps/meteor/app/statistics/server/lib/getAppsStatistics.ts @@ -41,7 +41,7 @@ async function _getAppsStatistics(): Promise { totalInstalled++; const status = await app.getStatus(); - const storageItem = await app.getStorageItem(); + const storageItem = app.getStorageItem(); if (storageItem.installationSource === AppInstallationSource.PRIVATE) { totalPrivateApps++; @@ -51,12 +51,10 @@ async function _getAppsStatistics(): Promise { } } - if (status === AppStatus.MANUALLY_DISABLED) { - totalFailed++; - } - if (AppStatusUtils.isEnabled(status)) { totalActive++; + } else if (status !== AppStatus.MANUALLY_DISABLED) { + totalFailed++; } }), );