Group configuration by component ownership
This commit is contained in:
parent
48a5b8a433
commit
67cc0cb802
1 changed files with 486 additions and 258 deletions
|
|
@ -30,10 +30,10 @@ main :: IO ()
|
|||
main = do
|
||||
hSetBuffering stdout LineBuffering
|
||||
cfg <- loadConfig
|
||||
withDb cfg $ \database -> do
|
||||
migrate database "sql" cfg
|
||||
withRedis cfg $ \redis -> do
|
||||
store <- newS3 cfg
|
||||
withDb (cfgPostgres cfg) $ \database -> do
|
||||
migrate database "sql" (cfgProduct cfg)
|
||||
withRedis (cfgRedis cfg) $ \redis -> do
|
||||
store <- newS3 (cfgS3 cfg)
|
||||
getArgs >>= \case
|
||||
[] -> getEnv "NUTHATCH_RECOVERY_PHASE" >>=
|
||||
runPhase cfg database redis store
|
||||
|
|
@ -253,8 +253,8 @@ prepareDelete cfg database redis store = do
|
|||
MutationFingerprint Delete key 0 Nothing
|
||||
}
|
||||
AdmissionLimits
|
||||
{ admissionMaxObjectBytes = cfgMaxObjectBytes cfg
|
||||
, admissionIdempotencyWindowSec = cfgIdempotencyWindowSec cfg
|
||||
{ admissionMaxObjectBytes = cfgMaxObjectBytes (cfgProduct cfg)
|
||||
, admissionIdempotencyWindowSec = cfgIdempotencyWindowSec (cfgProduct cfg)
|
||||
}
|
||||
prepared outcome
|
||||
|
||||
|
|
@ -266,8 +266,8 @@ beginDispatch cfg database rec = do
|
|||
connection
|
||||
rec
|
||||
DispatchTiming
|
||||
{ dispatchSettlementBoundSec = cfgObjectRequestTimeoutSec cfg * 2
|
||||
, dispatchWorkerGraceSec = cfgRecoveryGraceSec cfg
|
||||
{ dispatchSettlementBoundSec = cfgObjectRequestTimeoutSec (cfgRecovery cfg) * 2
|
||||
, dispatchWorkerGraceSec = cfgRecoveryGraceSec (cfgRecovery cfg)
|
||||
}
|
||||
pure (applying && pending)
|
||||
unless started (fail "could not begin dispatch")
|
||||
|
|
|
|||
Loading…
Reference in a new issue