diff options
Diffstat (limited to 'Omni/Task/Core.hs')
| -rw-r--r-- | Omni/Task/Core.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index ca9345f..4ff0f5f 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -619,12 +619,16 @@ listTasks maybeType maybeParent maybeStatus maybeNamespace = do getReadyTasks :: IO [Task] getReadyTasks = do allTasks <- loadTasks + retryContexts <- getAllRetryContexts let openTasks = filter (\t -> taskStatus t == Open || taskStatus t == InProgress) allTasks doneIds = map taskId <| filter (\t -> taskStatus t == Done) allTasks parentIds = mapMaybe taskParent allTasks isParent tid = tid `elem` parentIds + -- Tasks with retry_attempt >= 3 need human intervention + needsInterventionIds = [retryTaskId ctx | ctx <- retryContexts, retryAttempt ctx >= 3] + blockingDepIds task = [depId dep | dep <- taskDependencies task, depType dep `elem` [Blocks, ParentChild]] isReady task = taskType task @@ -633,6 +637,8 @@ getReadyTasks = do && all (`elem` doneIds) (blockingDepIds task) && taskType task /= HumanTask + && taskId task + `notElem` needsInterventionIds pure <| filter isReady openTasks -- Get dependency tree |
