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
175
Issues
175
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
e0a52fb1
Verified
Commit
e0a52fb1
authored
Mar 31, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[list] refactoring of csv post
parent
ce5d8d25
Pipeline
#3830
failed with stage
in 28 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
24 deletions
+16
-24
List.hs
src/Gargantext/API/Ngrams/List.hs
+16
-24
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
e0a52fb1
...
...
@@ -292,33 +292,25 @@ csvPost l m = do
------------------------------------------------------------------------
csvPostAsync
::
ServerT
CSVAPI
(
GargM
Env
GargError
)
csvPostAsync
lId
=
serveJobsAPI
UpdateNgramsListJobCSV
$
\
jHandle
f
@
(
WithTextFile
_ft
_
_n
)
->
do
serveJobsAPI
UpdateNgramsListJobCSV
$
\
jHandle
f
->
do
let
log''
x
=
do
-- printDebug "[csvPostAsync] filetype"
ft
-- printDebug "[csvPostAsync] name"
n
-- printDebug "[csvPostAsync] filetype"
(_wtf_filetype f)
-- printDebug "[csvPostAsync] name"
(_wtf_name f)
jobHandleLogger
jHandle
x
jl
<-
csvPostAsync'
lId
f
log''
printDebug
"[csvPostAsync] job ended with joblog: "
jl
let
jl
=
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
log''
jl
pure
jl
csvPostAsync'
::
FlowCmdM
env
err
m
=>
ListId
->
WithTextFile
->
(
JobLog
->
m
()
)
->
m
JobLog
csvPostAsync'
l
(
WithTextFile
_
m
_
)
logStatus
=
do
let
jl
=
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
logStatus
jl
ePost
<-
csvPost
l
m
case
ePost
of
Left
err
->
pure
$
jobLogFailTotalWithMessage
err
jl
Right
()
->
pure
$
jobLogSuccess
jl
ePost
<-
csvPost
lId
(
_wtf_data
f
)
let
jlNew
=
case
ePost
of
Left
err
->
jobLogFailTotalWithMessage
err
jl
Right
()
->
jobLogSuccess
jl
printDebug
"[csvPostAsync] job ended with joblog: "
jlNew
log''
jlNew
pure
jlNew
------------------------------------------------------------------------
...
...
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