Commit 8eedf115 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[async tasks] fix IsFinished if no errors

parent 8b4fb5d0
Pipeline #1976 failed with stage
......@@ -30,8 +30,13 @@ handleErrorInAsyncProgress :: T.Box (Array FrontendError)
-> Effect Unit
handleErrorInAsyncProgress errors ap@(AsyncProgress { status: IsFailure }) = do
T.modify_ (A.cons $ FStringError { error: concatErrors ap }) errors
handleErrorInAsyncProgress errors ap@(AsyncProgress { status: IsFinished }) = do
T.modify_ (A.cons $ FStringError { error: concatErrors ap }) errors
handleErrorInAsyncProgress errors ap@(AsyncProgress { log, status: IsFinished }) = do
if countFailed > 0 then
T.modify_ (A.cons $ FStringError { error: concatErrors ap }) errors
else
pure unit
where
countFailed = foldl (+) 0 $ (\(AsyncTaskLog { failed }) -> failed) <$> log
handleErrorInAsyncProgress _ _ = pure unit
concatErrors :: AsyncProgress -> String
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment