Skip to content

Commit

Permalink
fix: ptah-sh/ptah-server#239 better tracking of failed tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Oct 20, 2024
1 parent a870a61 commit b930fb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/app/ptah-agent/service_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ func (e *taskExecutor) monitorDaemonServiceLaunch(ctx context.Context, service *
return nil
}

tasksInDesiredState := 0
tasksRunning := 0
for _, t := range tasks {
if t.DesiredState == t.Status.State {
tasksInDesiredState++
if t.Status.State == swarm.TaskStateRunning {
tasksRunning++
}
}

if tasksInDesiredState == len(tasks) {
if tasksRunning == int(*service.Spec.Mode.Replicated.Replicas) {
successfullChecks++
} else {
successfullChecks = 0
Expand Down

0 comments on commit b930fb1

Please sign in to comment.