Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
add check on tasks length
Browse files Browse the repository at this point in the history
  • Loading branch information
acouvreur authored Apr 8, 2022
1 parent 951d89a commit 014731e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/scaler/docker_swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func (scaler *DockerSwarmScaler) isRunningFor(service *swarm.Service, duration t
return false
}

if len(tasks) == 0 {
log.Error("No task found with filter desired-state=running and service=", service.Spec.Name)
return false
}

// Getting 503 first time a workload is woken up https://github.com/acouvreur/traefik-ondemand-service/issues/24
// Let the service be up for a given duration
for _, task := range tasks {
Expand Down

0 comments on commit 014731e

Please sign in to comment.