From 2e787818d10c7b0b169a95b945ea568a00b96490 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Wed, 8 Nov 2023 21:32:22 +0100 Subject: [PATCH] fix removal condition --- cmd/woodpecker-autoscaler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/woodpecker-autoscaler.go b/cmd/woodpecker-autoscaler.go index 26340e7..0156cf6 100644 --- a/cmd/woodpecker-autoscaler.go +++ b/cmd/woodpecker-autoscaler.go @@ -86,7 +86,7 @@ func main() { "Caller": "Main", }).Fatal(fmt.Sprintf("Error checking woodpecker queue: %s", err.Error())) } - if runningTasks <= len(ownedNodes) && runningTasks != 0 && pendingTasks > 0 { + if (runningTasks <= len(ownedNodes) && runningTasks != 0) || pendingTasks > 0 { log.WithFields(log.Fields{ "Caller": "Main", }).Info("Still found running tasks. No agent to be removed")