From 7ed3e3664ff0dca14c012f72cb61883c84e2ba54 Mon Sep 17 00:00:00 2001 From: baalmart Date: Sun, 15 Dec 2024 00:26:38 +0300 Subject: [PATCH] just updating the logging logic for missing preferences --- src/auth-service/bin/jobs/preferences-log-job.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/auth-service/bin/jobs/preferences-log-job.js b/src/auth-service/bin/jobs/preferences-log-job.js index 5c2738ff4f..d7c951bfe6 100644 --- a/src/auth-service/bin/jobs/preferences-log-job.js +++ b/src/auth-service/bin/jobs/preferences-log-job.js @@ -77,12 +77,16 @@ const logUserPreferences = async () => { 100 ).toFixed(2); - logger.info( - `💔💔 Total count of users without Customised Locations in the default group: ${totalCountWithoutSelectedSites}, which is ${percentageWithoutSelectedSites}% of processed users.` - ); + if (totalCountWithoutSelectedSites > 0) { + logger.info( + `💔💔 Total count of users without Customised Locations in the default group: ${totalCountWithoutSelectedSites}, which is ${percentageWithoutSelectedSites}% of processed users.` + ); + } else { + logger.info(`😎🎉✅ All users have Customised Locations.`); + } } else { logger.info( - `😎🎉✅ No users processed or all users have Customised Locations.` + `🤔🤔 No users processed or no users belong to the default group.` ); } } catch (error) {