Skip to content

Commit

Permalink
skip action when count doesn't change
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Apr 28, 2020
1 parent 9ef3478 commit fc39078
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fc39078

Please sign in to comment.