forked from mtusi2026/mtusi2026lab3
feat(idempotency): purge expired keys
This commit is contained in:
@@ -32,6 +32,7 @@ type ServerConfig struct {
|
||||
Port string
|
||||
MaxInflightRequests int
|
||||
SessionTTL time.Duration
|
||||
IdempotencyTTL time.Duration
|
||||
InstanceID string
|
||||
}
|
||||
|
||||
@@ -62,6 +63,7 @@ func Load() Config {
|
||||
Port: getEnv("APP_PORT", "8080"),
|
||||
MaxInflightRequests: getEnvNonNegativeInt("MAX_INFLIGHT_REQUESTS", 0),
|
||||
SessionTTL: time.Duration(getEnvPositiveInt("SESSION_TTL_SECONDS", 3600)) * time.Second,
|
||||
IdempotencyTTL: time.Duration(getEnvPositiveInt("IDEMPOTENCY_TTL_SECONDS", 86400)) * time.Second,
|
||||
InstanceID: getInstanceID("INSTANCE_ID"),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user