checkDependencies 检查步骤依赖是否满足
(plan *ExecutionPlan, step *Step)
| 368 | |
| 369 | // checkDependencies 检查步骤依赖是否满足 |
| 370 | func (e *Executor) checkDependencies(plan *ExecutionPlan, step *Step) bool { |
| 371 | if len(step.DependsOn) == 0 { |
| 372 | return true |
| 373 | } |
| 374 | |
| 375 | for _, depID := range step.DependsOn { |
| 376 | found := false |
| 377 | for i := range plan.Steps { |
| 378 | if plan.Steps[i].ID == depID { |
| 379 | if plan.Steps[i].Status != StepStatusCompleted { |
| 380 | return false |
| 381 | } |
| 382 | found = true |
| 383 | break |
| 384 | } |
| 385 | } |
| 386 | if !found { |
| 387 | return false |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | return true |
| 392 | } |
| 393 | |
| 394 | // checkDependenciesWithMap 使用完成映射检查依赖 |
| 395 | func (e *Executor) checkDependenciesWithMap(step *Step, completed map[string]bool) bool { |