From f38ccd48551814b1d26849afd090f0cca4511281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Tich=C3=A1k?= Date: Fri, 15 Nov 2024 17:18:34 +0100 Subject: [PATCH] [core] removed wrong code in environment/manager.go TasksStateChangedEvent --- core/environment/manager.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/core/environment/manager.go b/core/environment/manager.go index b5c1f8b5..1c9f6783 100644 --- a/core/environment/manager.go +++ b/core/environment/manager.go @@ -170,23 +170,9 @@ func NewEnvManager(tm *task.Manager, incomingEventCh chan event.Event) *Manager instance.mu.RLock() thisEnvCh, ok := instance.pendingStateChangeCh[typedEvent.GetEnvironmentId()] instance.mu.RUnlock() + // If environment is not in state transition message is being propagated through task/manager if ok { thisEnvCh <- typedEvent - } else { - // If there is no pending environment transition, it means that the changed task did so - // unexpectedly. In that case, the environment should transition only if the task - // is critical. - var changeCriticalTask = false - for _, v := range typedEvent.GetTaskIds() { - if tm.GetTask(v) != nil { - if tm.GetTask(v).GetTraits().Critical == true { - changeCriticalTask = true - } - } - } - if changeCriticalTask { - thisEnvCh <- typedEvent - } } default: // noop