From 23e8c21726d7ef37f3208ef0649cb4576de545db Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Mon, 20 Nov 2023 10:46:03 -0500 Subject: [PATCH] :bug: Keep rule total in output logging (#435) Closes #434 Signed-off-by: Emily McMullan --- engine/engine.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/engine.go b/engine/engine.go index 6abf2bc7..c279ecdf 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -153,7 +153,6 @@ func (r *ruleEngine) RunRules(ctx context.Context, ruleSets []RuleSet, selectors // Need a better name for this thing ret := make(chan response) - var totalRules int32 var matchedRules int32 var unmatchedRules int32 var failedRules int32 @@ -195,8 +194,7 @@ func (r *ruleEngine) RunRules(ctx context.Context, ruleSets []RuleSet, selectors rs.Unmatched = append(rs.Unmatched, response.Rule.RuleID) } } - atomic.AddInt32(&totalRules, 1) - r.logger.V(5).Info("rule response received", "total", totalRules, "failed", failedRules, "matched", matchedRules, "unmatched", unmatchedRules) + r.logger.V(5).Info("rule response received", "total", len(otherRules), "failed", failedRules, "matched", matchedRules, "unmatched", unmatchedRules) }() case <-ctx.Done():