Skip to content

Commit 4216509

Browse files
author
Michal Tichák
committed
[core] reset currentRunNumber in GO_ERROR instead of transition_startactivity
1 parent 7a1243b commit 4216509

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

core/environment/environment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment,
614614
errorMsg = e.Err.Error()
615615
}
616616

617-
if e.Event == "STOP_ACTIVITY" {
618-
// If the event is STOP_ACTIVITY, we remove the active run number after all hooks are done.
617+
if e.Event == "STOP_ACTIVITY" || e.Event == "GO_ERROR" {
618+
// If the event is STOP_ACTIVITY or ERROR, we remove the active run number after all hooks are done.
619619
env.workflow.GetVars().Set("last_run_number", strconv.Itoa(int(env.currentRunNumber)))
620620
env.currentRunNumber = 0
621621
env.workflow.GetVars().Del("run_number")

core/environment/transition_startactivity.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func (t StartActivityTransition) do(env *Environment) (err error) {
8181
// Get a handle to the consolidated var stack of the root role of the env's workflow
8282
if wf := env.Workflow(); wf != nil {
8383
if cvs, cvsErr := wf.ConsolidatedVarStack(); cvsErr == nil {
84-
8584
// If bookkeeping is enabled and has fetched the LHC fill info, we can acquire it here
8685
for _, key := range []string{
8786
"fill_info_fill_number",
@@ -118,7 +117,6 @@ func (t StartActivityTransition) do(env *Environment) (err error) {
118117
incomingEv := <-env.stateChangedCh
119118
// If some tasks failed to transition
120119
if tasksStateErrors := incomingEv.GetTasksStateChangedError(); tasksStateErrors != nil {
121-
env.currentRunNumber = 0
122120
return tasksStateErrors
123121
}
124122

0 commit comments

Comments
 (0)