MarkStepCompleted 标记步骤完成
(index int, result any)
| 212 | |
| 213 | // MarkStepCompleted 标记步骤完成 |
| 214 | func (p *ExecutionPlan) MarkStepCompleted(index int, result any) { |
| 215 | if step := p.GetStep(index); step != nil { |
| 216 | now := time.Now() |
| 217 | step.Status = StepStatusCompleted |
| 218 | step.Result = result |
| 219 | step.CompletedAt = &now |
| 220 | if step.StartedAt != nil { |
| 221 | step.DurationMs = now.Sub(*step.StartedAt).Milliseconds() |
| 222 | } |
| 223 | p.UpdatedAt = now |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | // MarkStepFailed 标记步骤失败 |
| 228 | func (p *ExecutionPlan) MarkStepFailed(index int, err error) { |