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
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
Grégoire Locqueville
haskell-gargantext
Commits
519d41f4
Commit
519d41f4
authored
Dec 27, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[jobs] add JS_JOB_TIMEOUT/JS_ID_TIMEOUT settings for jobs
parent
c53aa1ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
7 deletions
+21
-7
gargantext.ini_toModify
gargantext.ini_toModify
+4
-0
Settings.hs
src/Gargantext/API/Admin/Settings.hs
+7
-3
Settings.hs
src/Gargantext/Utils/Jobs/Settings.hs
+6
-0
stack.yaml
stack.yaml
+4
-4
No files found.
gargantext.ini_toModify
View file @
519d41f4
...
@@ -40,6 +40,10 @@ FRAME_ISTEX_URL = URL_TO_CHANGE
...
@@ -40,6 +40,10 @@ FRAME_ISTEX_URL = URL_TO_CHANGE
MAX_DOCS_PARSERS = 1000000
MAX_DOCS_PARSERS = 1000000
MAX_DOCS_SCRAPERS = 10000
MAX_DOCS_SCRAPERS = 10000
# in seconds
JS_JOB_TIMEOUT = 1800
JS_ID_TIMEOUT = 1800
[server]
[server]
# Server config (TODO connect in ReaderMonad)
# Server config (TODO connect in ReaderMonad)
ALLOWED_ORIGIN = http://localhost
ALLOWED_ORIGIN = http://localhost
...
...
src/Gargantext/API/Admin/Settings.hs
View file @
519d41f4
...
@@ -43,13 +43,14 @@ import qualified Data.ByteString.Lazy as L
...
@@ -43,13 +43,14 @@ import qualified Data.ByteString.Lazy as L
import
Gargantext.API.Admin.EnvTypes
import
Gargantext.API.Admin.EnvTypes
import
Gargantext.API.Admin.Types
import
Gargantext.API.Admin.Types
-- import Gargantext.API.Ngrams.Types (NgramsRepo, HasRepo(..), RepoEnv(..), r_version, initRepo, renv_var, renv_lock)
-- import Gargantext.API.Ngrams.Types (NgramsRepo, HasRepo(..), RepoEnv(..), r_version, initRepo, renv_var, renv_lock)
import
Gargantext.Database.Prelude
(
databaseParameters
)
import
Gargantext.Database.Prelude
(
databaseParameters
,
hasConfig
)
import
Gargantext.Prelude
import
Gargantext.Prelude
-- import Gargantext.Prelude.Config (gc_repofilepath
)
import
Gargantext.Prelude.Config
(
gc_js_job_timeout
,
gc_js_id_timeout
)
import
qualified
Gargantext.Prelude.Mail
as
Mail
import
qualified
Gargantext.Prelude.Mail
as
Mail
import
qualified
Gargantext.Utils.Jobs
as
Jobs
import
qualified
Gargantext.Utils.Jobs
as
Jobs
import
qualified
Gargantext.Utils.Jobs.Monad
as
Jobs
import
qualified
Gargantext.Utils.Jobs.Monad
as
Jobs
import
qualified
Gargantext.Utils.Jobs.Queue
as
Jobs
import
qualified
Gargantext.Utils.Jobs.Queue
as
Jobs
import
qualified
Gargantext.Utils.Jobs.Settings
as
Jobs
devSettings
::
FilePath
->
IO
Settings
devSettings
::
FilePath
->
IO
Settings
devSettings
jwkFile
=
do
devSettings
jwkFile
=
do
...
@@ -192,7 +193,10 @@ newEnv port file = do
...
@@ -192,7 +193,10 @@ newEnv port file = do
scrapers_env
<-
newJobEnv
defaultSettings
manager_env
scrapers_env
<-
newJobEnv
defaultSettings
manager_env
secret
<-
Jobs
.
genSecret
secret
<-
Jobs
.
genSecret
jobs_env
<-
Jobs
.
newJobEnv
(
Jobs
.
defaultJobSettings
1
secret
)
prios'
manager_env
let
jobs_settings
=
(
Jobs
.
defaultJobSettings
1
secret
)
&
Jobs
.
l_jsJobTimeout
.~
(
fromIntegral
$
config_env
^.
hasConfig
^.
gc_js_job_timeout
)
&
Jobs
.
l_jsIDTimeout
.~
(
fromIntegral
$
config_env
^.
hasConfig
^.
gc_js_id_timeout
)
jobs_env
<-
Jobs
.
newJobEnv
jobs_settings
prios'
manager_env
logger
<-
newStderrLoggerSet
defaultBufSize
logger
<-
newStderrLoggerSet
defaultBufSize
config_mail
<-
Mail
.
readConfig
file
config_mail
<-
Mail
.
readConfig
file
...
...
src/Gargantext/Utils/Jobs/Settings.hs
View file @
519d41f4
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Utils.Jobs.Settings
where
module
Gargantext.Utils.Jobs.Settings
where
import
Control.Lens
import
Prelude
import
Prelude
import
qualified
Servant.Job.Core
as
SJ
import
qualified
Servant.Job.Core
as
SJ
...
@@ -12,3 +15,6 @@ data JobSettings = JobSettings
...
@@ -12,3 +15,6 @@ data JobSettings = JobSettings
,
jsGcPeriod
::
Int
-- in seconds, how long between each GC
,
jsGcPeriod
::
Int
-- in seconds, how long between each GC
,
jsSecretKey
::
SJ
.
SecretKey
,
jsSecretKey
::
SJ
.
SecretKey
}
}
makeLensesFor
[
(
"jsJobTimeout"
,
"l_jsJobTimeout"
)
,
(
"jsIDTimeout"
,
"l_jsIDTimeout"
)]
''
J
obSettings
stack.yaml
View file @
519d41f4
...
@@ -32,10 +32,10 @@ ghc-options:
...
@@ -32,10 +32,10 @@ ghc-options:
# "$everything": -haddock
# "$everything": -haddock
extra-deps
:
extra-deps
:
-
git
:
https://gitlab.iscpif.fr/gargantext/haskell-gargantext-prelude.git
#
- git: https://gitlab.iscpif.fr/gargantext/haskell-gargantext-prelude.git
commit
:
7bcd5fc5bad511892c4fd337cf2d4d23c1ec051b
#
commit: 7bcd5fc5bad511892c4fd337cf2d4d23c1ec051b
#
- git: https://gitlab.iscpif.fr/cgenie/haskell-gargantext-prelude
-
git
:
https://gitlab.iscpif.fr/cgenie/haskell-gargantext-prelude
# commit: 7b9656ce5180d2723301561b0715f06c7b905182
commit
:
791c2a7046a3760f8ae5fabdbd708f61caa63741
-
git
:
https://gitlab.iscpif.fr/gargantext/gargantext-graph.git
-
git
:
https://gitlab.iscpif.fr/gargantext/gargantext-graph.git
commit
:
588e104fe7593210956610cab0041fd16584a4ce
commit
:
588e104fe7593210956610cab0041fd16584a4ce
# Data Mining Libs
# Data Mining Libs
...
...
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