Skip to content

Commit 062a493

Browse files
authored
call func immediately without mgr in context (#187)
1 parent 2b8891c commit 062a493

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

step/run.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ func Run[T any](
3838
) (T, error) {
3939
targetID := getTargetStepID(ctx)
4040
mgr := preflight(ctx, enums.OpcodeStepRun)
41-
op := mgr.NewOp(enums.OpcodeStepRun, id)
42-
hashedID := op.MustHash()
4341

4442
if mgr == nil {
4543
// If there's no manager, execute the function directly.
4644
return f(ctx)
4745
}
4846

47+
op := mgr.NewOp(enums.OpcodeStepRun, id)
48+
hashedID := op.MustHash()
49+
4950
if val, ok := mgr.Step(ctx, op); ok {
5051
return loadExistingStep(id, mgr, val, f)
5152
}

0 commit comments

Comments
 (0)