Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
137
Issues
137
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
4a8000d8
Verified
Commit
4a8000d8
authored
Jan 31, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[notifications] fix error reporting for a job that fails immediately
Related to
#728
parent
c010d97a
Pipeline
#7291
passed with stages
in 22 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
AsyncTasks.purs
src/Gargantext/AsyncTasks.purs
+9
-0
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+11
-3
No files found.
src/Gargantext/AsyncTasks.purs
View file @
4a8000d8
...
@@ -3,6 +3,7 @@ module Gargantext.AsyncTasks
...
@@ -3,6 +3,7 @@ module Gargantext.AsyncTasks
, TaskList
, TaskList
, Storage(..)
, Storage(..)
, insert
, insert
, hasTask
, finish
, finish
, focus
, focus
-- , asyncTaskTTriggersAppReload
-- , asyncTaskTTriggersAppReload
...
@@ -78,6 +79,14 @@ insert id task storageBox = modifyTaskBox newStorage storageBox
...
@@ -78,6 +79,14 @@ insert id task storageBox = modifyTaskBox newStorage storageBox
where
where
newStorage (Storage s) = Storage $ Map.alter (maybe (Just [ task ]) (\ts -> Just $ A.nub $ A.cons task ts)) id s
newStorage (Storage s) = Storage $ Map.alter (maybe (Just [ task ]) (\ts -> Just $ A.nub $ A.cons task ts)) id s
hasTask :: GT.NodeID -> Task -> T.Box Storage -> Effect Boolean
hasTask id (GT.WorkerTask { message_id }) storage = do
Storage storage' <- T.read storage
case Map.lookup id storage' of
Nothing -> pure false
Just taskList ->
pure $ A.any (\(GT.WorkerTask { message_id: mId }) -> mId == message_id) taskList
finish :: GT.NodeID -> Task -> T.Box Storage -> Effect Unit
finish :: GT.NodeID -> Task -> T.Box Storage -> Effect Unit
finish id task storage = remove id task storage
finish id task storage = remove id task storage
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
4a8000d8
...
@@ -31,6 +31,7 @@ import Gargantext.Components.Lang (Lang(EN))
...
@@ -31,6 +31,7 @@ import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Components.Notifications as Notifications
import Gargantext.Components.Notifications as Notifications
import Gargantext.Components.Notifications.Types as NT
import Gargantext.Components.Notifications.Types as NT
import Gargantext.Config.Utils (handleErrorInAsyncTaskLog)
import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Context.Progress (asyncContext, asyncProgress)
import Gargantext.Ends (Frontends, url)
import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
...
@@ -258,9 +259,16 @@ nodeSpanCpt = here.component "nodeSpan" cpt
...
@@ -258,9 +259,16 @@ nodeSpanCpt = here.component "nodeSpan" cpt
void $ setTimeout 400 $ T2.reload reload
void $ setTimeout 400 $ T2.reload reload
NT.NUpdateWorkerProgress ji atl -> do
NT.NUpdateWorkerProgress ji atl -> do
-- TODO Fire this only once!
-- TODO Fire this only once!
-- here.log3 "[nodeSpan] update job progress" ji atl
here.log3 "[nodeSpan] update job progress" ji atl
if GT.asyncTaskLogIsFinished atl then pure unit
if GT.asyncTaskLogIsFinished atl then do
else
-- Handle error but only when the task is not already in the storage
-- (we want to avoid reporting the error multiple times, from different places).
-- See e.g. https://gitlab.iscpif.fr/gargantext/purescript-gargantext/issues/728
-- (error is thrown before the task marks any progress)
hasTask <- GAT.hasTask props.id ji boxes.tasks
unless hasTask $ do
handleErrorInAsyncTaskLog boxes.errors atl
else do
GAT.insert props.id ji boxes.tasks
GAT.insert props.id ji boxes.tasks
_ -> pure unit
_ -> pure unit
ws <- T.read boxes.wsNotification
ws <- T.read boxes.wsNotification
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment