]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Utils/Jobs/Settings.hs
[api] implement JSON errors
[gargantext.git] / src / Gargantext / Utils / Jobs / Settings.hs
1 {-# LANGUAGE TemplateHaskell #-}
2
3 module Gargantext.Utils.Jobs.Settings where
4
5 import Control.Lens
6 import Prelude
7
8 import qualified Servant.Job.Core as SJ
9
10 -- | A few control knobs for the job system.
11 data JobSettings = JobSettings
12 { jsNumRunners :: Int
13 , jsJobTimeout :: Int -- in seconds. TODO: timeout per job type? Map t Int
14 , jsIDTimeout :: Int -- in seconds, how long a job ID is valid
15 , jsGcPeriod :: Int -- in seconds, how long between each GC
16 , jsSecretKey :: SJ.SecretKey
17 }
18
19 makeLensesFor [ ("jsJobTimeout", "l_jsJobTimeout")
20 , ("jsIDTimeout", "l_jsIDTimeout")] ''JobSettings