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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
4dddd778
Verified
Commit
4dddd778
authored
Jul 21, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[job] fixes to addMoreSteps for jobs, tests included
parent
b298195d
Pipeline
#7762
passed with stages
in 47 minutes and 16 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
Job.hs
src/Gargantext/API/Job.hs
+7
-2
Env.hs
src/Gargantext/Core/Worker/Env.hs
+1
-1
Jobs.hs
test/Test/Utils/Jobs.hs
+25
-0
No files found.
src/Gargantext/API/Job.hs
View file @
4dddd778
...
...
@@ -23,7 +23,7 @@ module Gargantext.API.Job (
,
addWarningEvent
)
where
import
Control.Lens
(
over
,
_Just
)
import
Control.Lens
(
(
%~
),
over
,
_Just
)
import
Data.Text
qualified
as
T
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.Prelude
...
...
@@ -66,7 +66,12 @@ jobLogComplete jl =
&
over
scst_remaining
(
const
(
Just
0
))
jobLogAddMore
::
Int
->
JobLog
->
JobLog
jobLogAddMore
moreSteps
jl
=
jl
&
over
(
scst_remaining
.
_Just
)
(
+
moreSteps
)
jobLogAddMore
moreSteps
jl
=
jl
&
scst_remaining
%~
(
maybe
(
Just
0
)
Just
)
&
scst_succeeded
%~
(
maybe
(
Just
0
)
Just
)
&
scst_failed
%~
(
maybe
(
Just
0
)
Just
)
&
scst_events
%~
(
maybe
(
Just
[]
)
Just
)
&
(
scst_remaining
.
_Just
)
%~
(
+
moreSteps
)
jobLogFailures
::
Int
->
JobLog
->
JobLog
jobLogFailures
n
jl
=
over
(
scst_failed
.
_Just
)
(
+
n
)
$
...
...
src/Gargantext/Core/Worker/Env.hs
View file @
4dddd778
...
...
@@ -224,7 +224,7 @@ updateJobProgress (WorkerJobHandle (ji@JobInfo { _ji_message_id })) f = do
Just
wjs
->
do
(
CET
.
ce_notify
$
CET
.
UpdateWorkerProgress
ji
(
_wjs_job_log
wjs
))
`
CES
.
catch
`
(
\
(
e
::
SomeException
)
->
$
(
logLocM
)
ERROR
$
T
.
pack
$
displayException
e
)
$
(
logLocM
)
WARNING
$
T
.
pack
$
displayException
e
)
where
updateState
mwjs
=
let
initJobLog
=
...
...
test/Test/Utils/Jobs.hs
View file @
4dddd778
...
...
@@ -354,3 +354,28 @@ testMarkProgress = do
]
}
let
msgId2
=
(
fromJust
$
Aeson
.
decode
"2"
)
::
BT
.
MessageId
PGMQ
.
PGMQBroker
let
hdl2
=
WorkerJobHandle
{
_w_job_info
=
JobInfo
{
_ji_message_id
=
msgId2
,
_ji_mNode_id
=
Nothing
}
}
addMoreSteps
11
hdl2
jl7
<-
getLatestJobStatus
hdl2
liftBase
$
jl7
`
shouldBe
`
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
11
,
_scst_events
=
Just
[]
}
markStarted
1
hdl2
jl8
<-
getLatestJobStatus
hdl2
liftBase
$
jl8
`
shouldBe
`
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
addMoreSteps
11
hdl2
jl9
<-
getLatestJobStatus
hdl2
liftBase
$
jl9
`
shouldBe
`
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
12
,
_scst_events
=
Just
[]
}
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