From 4cc18c2ed056618cfdfdb2f8660c08f004d5eb27 Mon Sep 17 00:00:00 2001 From: Papa Bakary Camara Date: Fri, 10 Nov 2023 13:01:52 +0100 Subject: [PATCH] Do not log updated recommendation table msg if nothing was done --- storage/storage.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/storage/storage.go b/storage/storage.go index e00bdfc0..3eb33a0b 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -1211,12 +1211,14 @@ func (storage DBStorage) WriteRecommendationsForCluster( return err } - log.Info(). - Int64("Deleted", deleted). - Int("Inserted", inserted). - Int(organizationKey, int(orgID)). - Str(clusterKey, string(clusterName)). - Msg("Updated recommendation table") + if deleted != 0 || inserted != 0 { + log.Info(). + Int64("Deleted", deleted). + Int("Inserted", inserted). + Int(organizationKey, int(orgID)). + Str(clusterKey, string(clusterName)). + Msg("Updated recommendation table") + } // updateRecommendationsMetrics(string(clusterName), float64(deleted), float64(inserted)) return nil