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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
cca441fb
Commit
cca441fb
authored
Oct 28, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] separate async ngrams chart update endpoint
parent
922bb0b8
Pipeline
#1176
failed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+11
-11
Types.hs
src/Gargantext/API/Ngrams/Types.hs
+5
-6
No files found.
src/Gargantext/API/Ngrams.hs
View file @
cca441fb
...
...
@@ -349,14 +349,13 @@ tableNgramsPut tabType listId (Versioned p_version p_table)
pure
ret
tableNgramsP
ut
Async
::
(
FlowCmdM
env
err
m
tableNgramsP
ostCharts
Async
::
(
FlowCmdM
env
err
m
,
HasSettings
env
)
=>
UpdateTableNgram
s
=>
UpdateTableNgramsChart
s
->
(
JobLog
->
m
()
)
->
m
JobLog
tableNgramsPutAsync
utn
logStatus
=
do
-- let (Versioned p_version p_table) = utn ^. utn_patch
tableNgramsPostChartsAsync
utn
logStatus
=
do
let
tabType
=
utn
^.
utn_tab_type
let
listId
=
utn
^.
utn_list_id
...
...
@@ -658,8 +657,9 @@ type TableNgramsApi = TableNgramsApiGet
type
TableNgramsAsyncApi
=
Summary
"Table Ngrams Async API"
:>
"async"
:>
"charts"
:>
"update"
:>
AsyncJobs
JobLog
'[
J
SON
]
UpdateTableNgrams
JobLog
:>
AsyncJobs
JobLog
'[
J
SON
]
UpdateTableNgrams
Charts
JobLog
getTableNgramsCorpus
::
(
RepoCmdM
env
err
m
,
HasNodeError
err
,
HasConnectionPool
env
,
HasConfig
env
)
=>
NodeId
...
...
@@ -732,9 +732,9 @@ apiNgramsAsync _dId =
JobFunction
(
\
i
l
->
let
log'
x
=
do
printDebug
"tableNgramsP
ut
Async"
x
printDebug
"tableNgramsP
ostCharts
Async"
x
liftBase
$
l
x
in
tableNgramsP
ut
Async
i
log'
)
in
tableNgramsP
ostCharts
Async
i
log'
)
-- Did the given list of ngrams changed since the given version?
-- The returned value is versioned boolean value, meaning that one always retrieve the
...
...
src/Gargantext/API/Ngrams/Types.hs
View file @
cca441fb
...
...
@@ -738,16 +738,15 @@ ngramsTypeFromTabType tabType =
-- TODO: This `panic` would disapear with custom NgramsType.
----
--
PUT
Async task
-- Async task
data
UpdateTableNgrams
=
UpdateTableNgram
s
data
UpdateTableNgrams
Charts
=
UpdateTableNgramsChart
s
{
_utn_tab_type
::
!
TabType
,
_utn_list_id
::
!
ListId
,
_utn_patch
::
!
(
Versioned
NgramsTablePatch
)
}
deriving
(
Eq
,
Show
,
Generic
)
makeLenses
''
U
pdateTableNgrams
instance
FromJSON
UpdateTableNgrams
where
makeLenses
''
U
pdateTableNgrams
Charts
instance
FromJSON
UpdateTableNgrams
Charts
where
parseJSON
=
genericParseJSON
$
jsonOptions
"_utn_"
instance
ToSchema
UpdateTableNgrams
where
instance
ToSchema
UpdateTableNgrams
Charts
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_utn_"
)
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