feat(idempotency): purge expired keys

This commit is contained in:
kk10
2026-10-17 11:50:31 +03:00
parent 17ad9b691f
commit 59b06f5ec7
5 changed files with 61 additions and 5 deletions
+2
View File
@@ -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"),
},