MarkStepFailed 标记步骤失败
(index int, err error)
| 226 | |
| 227 | // MarkStepFailed 标记步骤失败 |
| 228 | func (p *ExecutionPlan) MarkStepFailed(index int, err error) { |
| 229 | if step := p.GetStep(index); step != nil { |
| 230 | now := time.Now() |
| 231 | step.Status = StepStatusFailed |
| 232 | step.Error = err.Error() |
| 233 | step.CompletedAt = &now |
| 234 | if step.StartedAt != nil { |
| 235 | step.DurationMs = now.Sub(*step.StartedAt).Milliseconds() |
| 236 | } |
| 237 | p.UpdatedAt = now |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | // Summary 返回计划摘要 |
| 242 | func (p *ExecutionPlan) Summary() PlanSummary { |