Skip to content

Commit b77cc0a

Browse files
Michal Tichákteo
authored andcommitted
[core] removed wrong code in environment/manager.go TasksStateChangedEvent
1 parent 8bf8da1 commit b77cc0a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

core/environment/manager.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,9 @@ func NewEnvManager(tm *task.Manager, incomingEventCh chan event.Event) *Manager
170170
instance.mu.RLock()
171171
thisEnvCh, ok := instance.pendingStateChangeCh[typedEvent.GetEnvironmentId()]
172172
instance.mu.RUnlock()
173+
// If environment is not in state transition message is being propagated through task/manager
173174
if ok {
174175
thisEnvCh <- typedEvent
175-
} else {
176-
// If there is no pending environment transition, it means that the changed task did so
177-
// unexpectedly. In that case, the environment should transition only if the task
178-
// is critical.
179-
var changeCriticalTask = false
180-
for _, v := range typedEvent.GetTaskIds() {
181-
if tm.GetTask(v) != nil {
182-
if tm.GetTask(v).GetTraits().Critical == true {
183-
changeCriticalTask = true
184-
}
185-
}
186-
}
187-
if changeCriticalTask {
188-
thisEnvCh <- typedEvent
189-
}
190176
}
191177
default:
192178
// noop

0 commit comments

Comments
 (0)