Skip to content

Commit b930fb1

Browse files
committed
fix: ptah-sh/ptah-server#239 better tracking of failed tasks
1 parent a870a61 commit b930fb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/app/ptah-agent/service_monitor.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ func (e *taskExecutor) monitorDaemonServiceLaunch(ctx context.Context, service *
8989
return nil
9090
}
9191

92-
tasksInDesiredState := 0
92+
tasksRunning := 0
9393
for _, t := range tasks {
94-
if t.DesiredState == t.Status.State {
95-
tasksInDesiredState++
94+
if t.Status.State == swarm.TaskStateRunning {
95+
tasksRunning++
9696
}
9797
}
9898

99-
if tasksInDesiredState == len(tasks) {
99+
if tasksRunning == int(*service.Spec.Mode.Replicated.Replicas) {
100100
successfullChecks++
101101
} else {
102102
successfullChecks = 0

0 commit comments

Comments
 (0)