Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
haskell-gargantext
Commits
a59fbab6
Commit
a59fbab6
authored
Jul 12, 2024
by
Loïc Chapron
Committed by
Grégoire Locqueville
Oct 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add warning to MonadJobStatus
parent
3030272d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
EnvTypes.hs
src/Gargantext/API/Admin/EnvTypes.hs
+8
-0
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+3
-1
Monad.hs
src/Gargantext/Utils/Jobs/Monad.hs
+4
-0
No files found.
src/Gargantext/API/Admin/EnvTypes.hs
View file @
a59fbab6
...
@@ -251,6 +251,12 @@ instance Jobs.MonadJobStatus (GargM Env err) where
...
@@ -251,6 +251,12 @@ instance Jobs.MonadJobStatus (GargM Env err) where
markComplete
jh
=
updateJobProgress
jh
jobLogComplete
markComplete
jh
=
updateJobProgress
jh
jobLogComplete
markWarning
mb_msg
jh
=
updateJobProgress
jh
(
\
latest
->
case
mb_msg
of
Nothing
->
jobLogFailTotal
latest
Just
msg
->
jobLogFailTotalWithMessage
msg
latest
)
markFailed
mb_msg
jh
=
markFailed
mb_msg
jh
=
updateJobProgress
jh
(
\
latest
->
case
mb_msg
of
updateJobProgress
jh
(
\
latest
->
case
mb_msg
of
Nothing
->
jobLogFailTotal
latest
Nothing
->
jobLogFailTotal
latest
...
@@ -328,6 +334,8 @@ instance Jobs.MonadJobStatus (GargM DevEnv err) where
...
@@ -328,6 +334,8 @@ instance Jobs.MonadJobStatus (GargM DevEnv err) where
markComplete
_
=
pure
()
markComplete
_
=
pure
()
markWarning
_
_
=
pure
()
markFailed
_
_
=
pure
()
markFailed
_
_
=
pure
()
addMoreSteps
_
_
=
pure
()
addMoreSteps
_
_
=
pure
()
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
a59fbab6
...
@@ -39,8 +39,8 @@ import Gargantext.Core (withDefaultLanguage, defaultLanguage)
...
@@ -39,8 +39,8 @@ import Gargantext.Core (withDefaultLanguage, defaultLanguage)
import
Gargantext.Core.Config
(
gc_jobs
,
hasConfig
)
import
Gargantext.Core.Config
(
gc_jobs
,
hasConfig
)
import
Gargantext.Core.Config.Types
(
jc_max_docs_parsers
)
import
Gargantext.Core.Config.Types
(
jc_max_docs_parsers
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
,
NgramsStatePatch
'
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
,
NgramsStatePatch
'
)
import
Gargantext.Core.Text.Corpus.Parsers
qualified
as
Parser
(
FileType
(
..
),
parseFormatC
,
_ParseFormatError
)
import
Gargantext.Core.Text.Corpus.Query
qualified
as
API
import
Gargantext.Core.Text.Corpus.Query
qualified
as
API
import
Gargantext.Core.Text.Corpus.Parsers
qualified
as
Parser
(
FileType
(
..
),
parseFormatC
,
_ParseFormatError
,
ParseFormatError
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Action.Flow
(
flowCorpus
,
getDataText
,
flowDataText
,
TermType
(
..
)
{-, allDataOrigins-}
)
import
Gargantext.Database.Action.Flow
(
flowCorpus
,
getDataText
,
flowDataText
,
TermType
(
..
)
{-, allDataOrigins-}
)
...
@@ -294,6 +294,8 @@ addToCorpusWithForm user cid nwf jobHandle = do
...
@@ -294,6 +294,8 @@ addToCorpusWithForm user cid nwf jobHandle = do
-- printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text)
-- printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text)
-- TODO uncomment this
-- TODO uncomment this
--sendMail user
--sendMail user
markWarning
(
Just
(
Parser
.
ParseFormatError
{
_ParseFormatError
=
T
.
pack
"test"
}))
jobHandle
$
(
logLocM
)
WARNING
$
T
.
pack
$
"Warning in parsing"
markComplete
jobHandle
markComplete
jobHandle
Left
parseErr
->
do
Left
parseErr
->
do
...
...
src/Gargantext/Utils/Jobs/Monad.hs
View file @
a59fbab6
...
@@ -224,6 +224,10 @@ class MonadJobStatus m where
...
@@ -224,6 +224,10 @@ class MonadJobStatus m where
-- | Finish tracking a job by marking all the remaining steps as succeeded.
-- | Finish tracking a job by marking all the remaining steps as succeeded.
markComplete
::
JobHandle
m
->
m
()
markComplete
::
JobHandle
m
->
m
()
-- | Finish tracking a job by marking all the remaining steps as failed. Attach an optional
-- message to the failure.
markWarning
::
forall
e
.
ToHumanFriendlyError
e
=>
Maybe
e
->
JobHandle
m
->
m
()
-- | Finish tracking a job by marking all the remaining steps as failed. Attach an optional
-- | Finish tracking a job by marking all the remaining steps as failed. Attach an optional
-- message to the failure.
-- message to the failure.
markFailed
::
forall
e
.
ToHumanFriendlyError
e
=>
Maybe
e
->
JobHandle
m
->
m
()
markFailed
::
forall
e
.
ToHumanFriendlyError
e
=>
Maybe
e
->
JobHandle
m
->
m
()
...
...
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