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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
6981d86b
Commit
6981d86b
authored
Oct 18, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] numRunners to 1 by default for now
parent
ca99d1c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
Settings.hs
src/Gargantext/API/Admin/Settings.hs
+1
-1
API.hs
src/Gargantext/Utils/Jobs/API.hs
+2
-1
Monad.hs
src/Gargantext/Utils/Jobs/Monad.hs
+5
-3
Main.hs
tests/queue/Main.hs
+3
-3
No files found.
src/Gargantext/API/Admin/Settings.hs
View file @
6981d86b
...
...
@@ -192,7 +192,7 @@ newEnv port file = do
scrapers_env
<-
newJobEnv
defaultSettings
manager_env
secret
<-
Jobs
.
genSecret
jobs_env
<-
Jobs
.
newJobEnv
(
Jobs
.
defaultJobSettings
secret
)
prios'
manager_env
jobs_env
<-
Jobs
.
newJobEnv
(
Jobs
.
defaultJobSettings
1
secret
)
prios'
manager_env
logger
<-
newStderrLoggerSet
defaultBufSize
config_mail
<-
Mail
.
readConfig
file
...
...
src/Gargantext/Utils/Jobs/API.hs
View file @
6981d86b
...
...
@@ -9,6 +9,7 @@ import Control.Monad
import
Control.Monad.Except
import
Data.Aeson
(
ToJSON
)
import
Data.Monoid
import
Data.Kind
(
Type
)
import
Prelude
import
Servant.API
...
...
@@ -38,7 +39,7 @@ serveJobsAPI getenv t joberr f
:<|>
serveJobAPI
t
joberr
serveJobAPI
::
forall
(
m
::
*
->
*
)
e
t
event
output
.
::
forall
(
m
::
Type
->
Type
)
e
t
event
output
.
(
Ord
t
,
MonadError
e
m
,
MonadJob
m
t
(
Dual
[
event
])
output
)
=>
t
->
(
JobError
->
e
)
...
...
src/Gargantext/Utils/Jobs/Monad.hs
View file @
6981d86b
...
...
@@ -31,9 +31,11 @@ newJobEnv
->
IO
(
JobEnv
t
w
a
)
newJobEnv
js
prios
mgr
=
JobEnv
js
<$>
newJobsState
js
prios
<*>
pure
mgr
defaultJobSettings
::
SJ
.
SecretKey
->
JobSettings
defaultJobSettings
k
=
JobSettings
{
jsNumRunners
=
2
type
NumRunners
=
Int
defaultJobSettings
::
NumRunners
->
SJ
.
SecretKey
->
JobSettings
defaultJobSettings
numRunners
k
=
JobSettings
{
jsNumRunners
=
numRunners
,
jsJobTimeout
=
30
*
60
-- 30 minutes
,
jsIDTimeout
=
30
*
60
-- 30 minutes
,
jsGcPeriod
=
1
*
60
-- 1 minute
...
...
tests/queue/Main.hs
View file @
6981d86b
...
...
@@ -31,7 +31,7 @@ dec B cs = cs { countBs = countBs cs - 1 }
testMaxRunners
=
do
-- max runners = 2 with default settings
k
<-
genSecret
let
settings
=
defaultJobSettings
k
let
settings
=
defaultJobSettings
2
k
st
::
JobsState
JobT
[
String
]
()
<-
newJobsState
settings
defaultPrios
runningJs
<-
newTVarIO
[]
let
j
num
_inp
l
=
do
...
...
@@ -57,7 +57,7 @@ testMaxRunners = do
testPrios
=
do
k
<-
genSecret
let
settings
=
defaultJobSettings
k
let
settings
=
defaultJobSettings
2
k
st
::
JobsState
JobT
[
String
]
()
<-
newJobsState
settings
$
applyPrios
[(
B
,
10
)]
defaultPrios
-- B has higher priority
runningJs
<-
newTVarIO
(
Counts
0
0
)
...
...
@@ -88,7 +88,7 @@ testPrios = do
testExceptions
=
do
-- max runners = 2 with default settings
k
<-
genSecret
let
settings
=
defaultJobSettings
k
let
settings
=
defaultJobSettings
2
k
st
::
JobsState
JobT
[
String
]
()
<-
newJobsState
settings
defaultPrios
jid
<-
pushJob
A
()
(
\
_inp
_log
->
readFile
"/doesntexist.txt"
>>=
putStrLn
)
...
...
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