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
199
Issues
199
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
051978f1
Commit
051978f1
authored
Nov 03, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] fix job prelude, compiles now with MonadBase IO
parent
3d954f25
Pipeline
#1186
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+1
-2
Routes.hs
src/Gargantext/API/Routes.hs
+1
-1
Job.hs
src/Gargantext/Prelude/Job.hs
+7
-7
No files found.
src/Gargantext/API/Ngrams.hs
View file @
051978f1
...
...
@@ -114,7 +114,7 @@ import Test.QuickCheck (elements)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
import
Prelude
(
error
)
import
Gargantext.Prelude
import
Gargantext.Prelude
hiding
(
log
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
...
...
@@ -133,7 +133,6 @@ import Gargantext.Database.Prelude (HasConnectionPool, HasConfig)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Table.Node.Select
import
Gargantext.Database.Query.Table.Ngrams
hiding
(
NgramsType
(
..
),
ngrams
,
ngramsType
,
ngrams_terms
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
qualified
Gargantext.Database.Query.Table.Ngrams
as
TableNgrams
import
Gargantext.Database.Query.Table.Node
(
getNode
)
import
Gargantext.Database.Schema.Node
(
node_id
,
node_parentId
,
node_userId
)
...
...
src/Gargantext/API/Routes.hs
View file @
051978f1
...
...
@@ -251,7 +251,7 @@ addCorpusWithQuery user cid =
serveJobsAPI
$
JobFunction
(
\
q
log
->
do
limit
<-
view
$
config
.
gc_max_docs_scrapers
New
.
a
https
://
filezilla
-
project
.
org
/
ddToCorpusWithQuery
user
cid
q
(
Just
limit
)
(
liftBase
.
log
)
New
.
addToCorpusWithQuery
user
cid
q
(
Just
limit
)
(
liftBase
.
log
)
{- let log' x = do
printDebug "addToCorpusWithQuery" x
liftBase $ log x
...
...
src/Gargantext/Prelude/Job.hs
View file @
051978f1
module
Gargantext.Prelude.Job
where
import
Control.Monad.IO.Class
(
liftIO
,
MonadIO
)
import
Data.IORef
import
Data.Maybe
...
...
@@ -8,6 +7,7 @@ import Gargantext.Prelude
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
))
jobLogInit
::
Int
->
JobLog
jobLogInit
rem
=
JobLog
{
_scst_succeeded
=
Just
0
...
...
@@ -36,18 +36,18 @@ jobLogFail (JobLog { _scst_succeeded = mSucc
,
_scst_failed
=
(
+
1
)
<$>
mFail
,
_scst_events
=
evt
}
runJobLog
::
Monad
IO
io
=>
Int
->
(
JobLog
->
io
()
)
->
io
(
io
()
,
io
()
,
io
JobLog
)
runJobLog
::
Monad
Base
IO
m
=>
Int
->
(
JobLog
->
m
()
)
->
m
(
m
()
,
m
()
,
m
JobLog
)
runJobLog
num
logStatus
=
do
jlRef
<-
lift
IO
$
newIORef
$
jobLogInit
num
jlRef
<-
lift
Base
$
newIORef
$
jobLogInit
num
return
(
logRefF
jlRef
,
logRefSuccessF
jlRef
,
getRefF
jlRef
)
where
logRefF
ref
=
do
jl
<-
lift
IO
$
readIORef
ref
jl
<-
lift
Base
$
readIORef
ref
logStatus
jl
logRefSuccessF
ref
=
do
jl
<-
lift
IO
$
readIORef
ref
lift
IO
$
writeIORef
ref
$
jobLogSuccess
jl
jl
<-
lift
Base
$
readIORef
ref
lift
Base
$
writeIORef
ref
$
jobLogSuccess
jl
getRefF
ref
=
do
lift
IO
$
readIORef
ref
lift
Base
$
readIORef
ref
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