Skip to content

Commit cb6e001

Browse files
knopers8teo
authored andcommitted
Use SetRuntimeVar to handle SOR/EOR times
This makes sure they are overwritten for all child roles
1 parent adaf3a5 commit cb6e001

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/environment/environment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ func newEnvironment(userVars map[string]string) (env *Environment, err error) {
148148
env.workflow.GetVars().Set("runNumber", rnString)
149149

150150
runStartTime := strconv.FormatInt(time.Now().UnixNano()/1000000, 10)
151-
env.workflow.GetVars().Set("run_start_time_ms", runStartTime)
152-
env.workflow.GetVars().Del("run_end_time_ms") // we delete previous EOR
151+
env.workflow.SetRuntimeVar("run_start_time_ms", runStartTime)
152+
env.workflow.SetRuntimeVar("run_end_time_ms", "") // we delete previous EOR
153153

154154
configStack, err := gera.MakeStringMapWithMap(apricot.Instance().GetVars()).WrappedAndFlattened(gera.MakeStringMapWithMap(apricot.Instance().GetDefaults()))
155155
if err == nil {
@@ -166,7 +166,7 @@ func newEnvironment(userVars map[string]string) (env *Environment, err error) {
166166
}
167167
} else if e.Event == "STOP_ACTIVITY" {
168168
runEndTime := strconv.FormatInt(time.Now().UnixNano()/1000000, 10)
169-
env.workflow.GetVars().Set("run_end_time_ms", runEndTime)
169+
env.workflow.SetRuntimeVar("run_end_time_ms", runEndTime)
170170
}
171171
errHooks := env.handleHooks(env.Workflow(), fmt.Sprintf("before_%s", e.Event))
172172
if errHooks != nil {

0 commit comments

Comments
 (0)