Expire terminal mutation identities by configured epoch
This commit is contained in:
parent
4b044b1456
commit
cc23211e63
1 changed files with 565 additions and 12 deletions
|
|
@ -50,6 +50,7 @@ data Config = Config
|
|||
, cfgListCacheTtlSec :: Integer
|
||||
, cfgSearchMaxKeys :: Int
|
||||
, cfgRecoveryGraceSec :: Integer
|
||||
, cfgIdempotencyWindowSec :: Integer
|
||||
}
|
||||
|
||||
loadConfig :: IO Config
|
||||
|
|
@ -112,6 +113,9 @@ loadConfig = do
|
|||
listTtl <- envInteger "NUTHATCH_LIST_CACHE_TTL_SEC" 30
|
||||
searchMax <- fromInteger <$> envInteger "NUTHATCH_SEARCH_MAX_KEYS" 500
|
||||
recoveryGrace <- envInteger "NUTHATCH_RECOVERY_GRACE_SEC" 90
|
||||
idempotencyWindow <- envInteger "NUTHATCH_IDEMPOTENCY_WINDOW_SEC" 86400
|
||||
when (idempotencyWindow <= 0) $
|
||||
fail "NUTHATCH_IDEMPOTENCY_WINDOW_SEC must be positive"
|
||||
pure Config
|
||||
{ cfgListenHost = host
|
||||
, cfgListenPort = port
|
||||
|
|
@ -148,6 +152,7 @@ loadConfig = do
|
|||
, cfgListCacheTtlSec = listTtl
|
||||
, cfgSearchMaxKeys = searchMax
|
||||
, cfgRecoveryGraceSec = recoveryGrace
|
||||
, cfgIdempotencyWindowSec = idempotencyWindow
|
||||
}
|
||||
|
||||
luaExactIntegerMax :: Integer
|
||||
|
|
|
|||
Loading…
Reference in a new issue