Skip to content

Commit 0fefbb3

Browse files
justonedev1teo
authored andcommitted
[core] tasks no longer update state to their parents if they are not critical
1 parent c41ab1f commit 0fefbb3

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

core/workflow/callrole.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ func (t *callRole) updateState(s task.State) {
228228
WithField("partition", t.GetEnvironmentId().String()).
229229
Tracef("updated state to %s upon input state %s", t.state.get().String(), s.String())
230230
t.SendEvent(&event.RoleEvent{Name: t.Name, State: t.state.get().String(), RolePath: t.GetPath()})
231-
t.parent.updateState(s)
231+
232+
if t.Critical == true || s != task.ERROR {
233+
t.parent.updateState(s)
234+
}
232235
}
233236

234237
func (t *callRole) copy() copyable {

core/workflow/taskrole.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ func (t *taskRole) updateState(s task.State) {
232232
WithField("partition", t.GetEnvironmentId().String()).
233233
Tracef("updated state to %s upon input state %s", t.state.get().String(), s.String())
234234
t.SendEvent(&event.RoleEvent{Name: t.Name, State: t.state.get().String(), RolePath: t.GetPath()})
235-
t.parent.updateState(s)
235+
236+
if t.Critical == true || s != task.ERROR {
237+
t.parent.updateState(s)
238+
}
236239
}
237240

238241
func (t *taskRole) SetTask(taskPtr *task.Task) {

0 commit comments

Comments
 (0)