Commit 6981d86b authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] numRunners to 1 by default for now

parent ca99d1c1
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment