MCPcopy Create free account
hub / github.com/astercloud/aster / MarkStepFailed

Method MarkStepFailed

pkg/executionplan/types.go:228–239  ·  view source on GitHub ↗

MarkStepFailed 标记步骤失败

(index int, err error)

Source from the content-addressed store, hash-verified

226
227// MarkStepFailed 标记步骤失败
228func (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 返回计划摘要
242func (p *ExecutionPlan) Summary() PlanSummary {

Callers 2

TestMarkStepFailedFunction · 0.95
executeStepMethod · 0.80

Calls 2

GetStepMethod · 0.95
ErrorMethod · 0.65

Tested by 1

TestMarkStepFailedFunction · 0.76