Group configuration by component ownership

This commit is contained in:
ms2k 2026-07-20 02:21:33 +09:00
commit 67cc0cb802

View file

@ -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")