Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
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
Changes
5
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
...
@@ -181,9 +181,8 @@ makeMockApp env = do
makeDevMiddleware
::
Mode
->
IO
Middleware
makeDevMiddleware
::
Mode
->
IO
Middleware
makeDevMiddleware
mode
=
do
makeDevMiddleware
mode
=
do
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger $ env^.logger }
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger $ env^.logger }
-- logWare <- mkRequestLogger def { destination = RequestLogger.Logger "/tmp/logs.txt" }
--logWare <- mkRequestLogger def { destination = RequestLogger.Logger "/tmp/logs.txt" }
-- let checkOriginAndHost app req resp = do
-- let checkOriginAndHost app req resp = do
-- blocking <- fireWall req (env ^. menv_firewall)
-- blocking <- fireWall req (env ^. menv_firewall)
-- case blocking of
-- case blocking of
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
80c2bb9e
...
@@ -184,9 +184,10 @@ addToCorpusWithQuery :: FlowCmdM env err m
...
@@ -184,9 +184,10 @@ addToCorpusWithQuery :: FlowCmdM env err m
=>
User
=>
User
->
CorpusId
->
CorpusId
->
WithQuery
->
WithQuery
->
Maybe
Integer
->
(
JobLog
->
m
()
)
->
(
JobLog
->
m
()
)
->
m
JobLog
->
m
JobLog
addToCorpusWithQuery
u
cid
(
WithQuery
q
dbs
l
_nid
)
logStatus
=
do
addToCorpusWithQuery
u
cid
(
WithQuery
q
dbs
l
_nid
)
maybeLimit
logStatus
=
do
-- TODO ...
-- TODO ...
logStatus
JobLog
{
_scst_succeeded
=
Just
0
logStatus
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
...
@@ -198,7 +199,7 @@ addToCorpusWithQuery u cid (WithQuery q dbs l _nid) logStatus = do
...
@@ -198,7 +199,7 @@ addToCorpusWithQuery u cid (WithQuery q dbs l _nid) logStatus = do
-- TODO if cid is folder -> create Corpus
-- TODO if cid is folder -> create Corpus
-- if cid is corpus -> add to corpus
-- if cid is corpus -> add to corpus
-- if cid is root -> create corpus in Private
-- 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
logStatus
JobLog
{
_scst_succeeded
=
Just
2
,
_scst_failed
=
Just
0
,
_scst_failed
=
Just
0
...
...
src/Gargantext/API/Prelude.hs
View file @
80c2bb9e
...
@@ -81,8 +81,8 @@ type GargServerC env err m =
...
@@ -81,8 +81,8 @@ type GargServerC env err m =
,
HasJoseError
err
,
HasJoseError
err
,
ToJSON
err
-- TODO this is arguable
,
ToJSON
err
-- TODO this is arguable
,
Exception
err
,
Exception
err
,
HasRepo
env
,
HasRepo
env
-- TODO rename HasNgramsRepo
,
HasSettings
env
,
HasSettings
env
-- TODO rename HasDbSettings
,
HasJobEnv
env
JobLog
JobLog
,
HasJobEnv
env
JobLog
JobLog
,
HasConfig
env
,
HasConfig
env
)
)
...
...
src/Gargantext/API/Routes.hs
View file @
80c2bb9e
...
@@ -26,6 +26,7 @@ module Gargantext.API.Routes
...
@@ -26,6 +26,7 @@ module Gargantext.API.Routes
-- import qualified Gargantext.API.Search as Search
-- import qualified Gargantext.API.Search as Search
import
Control.Concurrent
(
threadDelay
)
import
Control.Concurrent
(
threadDelay
)
-- import Control.Lens (view)
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Validity
import
Data.Validity
import
Gargantext.API.Admin.Auth
(
AuthRequest
,
AuthResponse
,
AuthenticatedUser
(
..
),
withAccess
,
PathId
(
..
))
import
Gargantext.API.Admin.Auth
(
AuthRequest
,
AuthResponse
,
AuthenticatedUser
(
..
),
withAccess
,
PathId
(
..
))
...
@@ -36,6 +37,7 @@ import Gargantext.API.Node
...
@@ -36,6 +37,7 @@ import Gargantext.API.Node
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Viz.Graph.API
import
Gargantext.Core.Viz.Graph.API
-- import Gargantext.Database.Prelude (HasConfig(..))
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
CorpusId
,
AnnuaireId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
CorpusId
,
AnnuaireId
)
...
@@ -245,14 +247,17 @@ waitAPI n = do
...
@@ -245,14 +247,17 @@ waitAPI n = do
----------------------------------------
----------------------------------------
addCorpusWithQuery
::
User
->
GargServer
New
.
AddWithQuery
addCorpusWithQuery
::
User
->
GargServer
New
.
AddWithQuery
addCorpusWithQuery
user
cid
=
addCorpusWithQuery
user
cid
=
do
-- TODO gargantext.ini
-- _env <- view hasConfig
let
limit
=
Just
10000
serveJobsAPI
$
serveJobsAPI
$
JobFunction
(
\
q
log
->
JobFunction
(
\
q
log
->
let
let
log'
x
=
do
log'
x
=
do
printDebug
"addToCorpusWithQuery"
x
printDebug
"addToCorpusWithQuery"
x
liftBase
$
log
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
...
@@ -36,7 +36,7 @@ get :: ExternalAPIs
->
Query
->
Query
->
Maybe
Limit
->
Maybe
Limit
->
IO
[
HyperdataDocument
]
->
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
HAL
la
q
l
=
HAL
.
get
la
q
l
get
IsTex
la
q
l
=
ISTEX
.
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
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