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
80c2bb9e
Commit
80c2bb9e
authored
Sep 17, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CONFIG] limit to crawlers
parent
a70b2a4e
Pipeline
#1072
failed with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
API.hs
src/Gargantext/API.hs
+2
-3
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+3
-2
Prelude.hs
src/Gargantext/API/Prelude.hs
+2
-2
Routes.hs
src/Gargantext/API/Routes.hs
+7
-2
API.hs
src/Gargantext/Core/Text/Corpus/API.hs
+1
-1
No files found.
src/Gargantext/API.hs
View file @
80c2bb9e
...
...
@@ -181,9 +181,8 @@ makeMockApp env = do
makeDevMiddleware
::
Mode
->
IO
Middleware
makeDevMiddleware
mode
=
do
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger $ env^.logger }
--logWare <- mkRequestLogger def { destination = RequestLogger.Logger "/tmp/logs.txt" }
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger $ env^.logger }
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger "/tmp/logs.txt" }
-- let checkOriginAndHost app req resp = do
-- blocking <- fireWall req (env ^. menv_firewall)
-- case blocking of
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
80c2bb9e
...
...
@@ -184,9 +184,10 @@ addToCorpusWithQuery :: FlowCmdM env err m
=>
User
->
CorpusId
->
WithQuery
->
Maybe
Integer
->
(
JobLog
->
m
()
)
->
m
JobLog
addToCorpusWithQuery
u
cid
(
WithQuery
q
dbs
l
_nid
)
logStatus
=
do
addToCorpusWithQuery
u
cid
(
WithQuery
q
dbs
l
_nid
)
maybeLimit
logStatus
=
do
-- TODO ...
logStatus
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
...
...
@@ -198,7 +199,7 @@ addToCorpusWithQuery u cid (WithQuery q dbs l _nid) logStatus = do
-- TODO if cid is folder -> create Corpus
-- if cid is corpus -> add to corpus
-- if cid is root -> create corpus in Private
txts
<-
mapM
(
\
db
->
getDataText
db
(
Multi
l
)
q
Nothing
)
[
database2origin
dbs
]
txts
<-
mapM
(
\
db
->
getDataText
db
(
Multi
l
)
q
maybeLimit
)
[
database2origin
dbs
]
logStatus
JobLog
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
...
...
src/Gargantext/API/Prelude.hs
View file @
80c2bb9e
...
...
@@ -81,8 +81,8 @@ type GargServerC env err m =
,
HasJoseError
err
,
ToJSON
err
-- TODO this is arguable
,
Exception
err
,
HasRepo
env
,
HasSettings
env
,
HasRepo
env
-- TODO rename HasNgramsRepo
,
HasSettings
env
-- TODO rename HasDbSettings
,
HasJobEnv
env
JobLog
JobLog
,
HasConfig
env
)
...
...
src/Gargantext/API/Routes.hs
View file @
80c2bb9e
...
...
@@ -26,6 +26,7 @@ module Gargantext.API.Routes
-- import qualified Gargantext.API.Search as Search
import
Control.Concurrent
(
threadDelay
)
-- import Control.Lens (view)
import
Data.Text
(
Text
)
import
Data.Validity
import
Gargantext.API.Admin.Auth
(
AuthRequest
,
AuthResponse
,
AuthenticatedUser
(
..
),
withAccess
,
PathId
(
..
))
...
...
@@ -36,6 +37,7 @@ import Gargantext.API.Node
import
Gargantext.API.Prelude
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Viz.Graph.API
-- import Gargantext.Database.Prelude (HasConfig(..))
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
CorpusId
,
AnnuaireId
)
...
...
@@ -245,14 +247,17 @@ waitAPI n = do
----------------------------------------
addCorpusWithQuery
::
User
->
GargServer
New
.
AddWithQuery
addCorpusWithQuery
user
cid
=
addCorpusWithQuery
user
cid
=
do
-- TODO gargantext.ini
-- _env <- view hasConfig
let
limit
=
Just
10000
serveJobsAPI
$
JobFunction
(
\
q
log
->
let
log'
x
=
do
printDebug
"addToCorpusWithQuery"
x
liftBase
$
log
x
in
New
.
addToCorpusWithQuery
user
cid
q
log'
in
New
.
addToCorpusWithQuery
user
cid
q
l
imit
l
og'
)
{-
...
...
src/Gargantext/Core/Text/Corpus/API.hs
View file @
80c2bb9e
...
...
@@ -36,7 +36,7 @@ get :: ExternalAPIs
->
Query
->
Maybe
Limit
->
IO
[
HyperdataDocument
]
get
PubMed
_la
q
l
=
PUBMED
.
get
q
l
-- EN only by default
get
PubMed
_la
q
l
=
PUBMED
.
get
q
l
-- EN only by default
get
HAL
la
q
l
=
HAL
.
get
la
q
l
get
IsTex
la
q
l
=
ISTEX
.
get
la
q
l
get
Isidore
la
q
l
=
ISIDORE
.
get
la
(
fromIntegral
<$>
l
)
(
Just
q
)
Nothing
...
...
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