Skip to content

Commit

Permalink
nil guard if Vertex errs
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed Nov 26, 2024
1 parent 305b1f3 commit 328fd9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/services/workflows/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,14 @@ func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) {
inputs, outputs, err := e.executeStep(ctx, l, msg)
stepExecutionDuration := time.Since(stepExecutionStartTime).Seconds()

curStepID := "UNSET"
curStep, verr := e.workflow.Vertex(msg.stepRef)
if verr != nil {
if verr == nil {
curStepID = curStep.ID
} else {
l.Errorf("failed to resolve step in workflow; error %v", err)
}
e.metrics.with(platform.KeyCapabilityID, curStep.ID).updateWorkflowStepDurationHistogram(ctx, int64(stepExecutionDuration))
e.metrics.with(platform.KeyCapabilityID, curStepID).updateWorkflowStepDurationHistogram(ctx, int64(stepExecutionDuration))

var stepStatus string
switch {
Expand Down

0 comments on commit 328fd9f

Please sign in to comment.