From fc390782cebedde225704868b78ce6696774b5b3 Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Tue, 28 Apr 2020 12:26:58 -0400 Subject: [PATCH] skip action when count doesn't change --- agent/agent.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index bb4567cd..c4b76dc4 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -278,6 +278,12 @@ func (a *Agent) handlePolicy(p *policystorage.Policy) { actionLogger.Info("registering scaling event", "count", currentCount, "reason", action.Reason, "meta", action.Meta) } else { + // Skip action if count doesn't change. + if currentCount == *action.Count { + actionLogger.Info("nothing to do", "from", currentCount, "to", *action.Count) + continue + } + actionLogger.Info("scaling target", "from", currentCount, "to", *action.Count, "reason", action.Reason, "meta", action.Meta)