Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: use shorter in-memory fallback TTL to bound memory during Redis outages

Devin AIdbd0518af7b1
diff --git a/backend/src/services/telemetry/telemetry-service.ts b/backend/src/services/telemetry/telemetry-service.ts
index 8af0f523a6..94fe26e4fd 100644
--- a/backend/src/services/telemetry/telemetry-service.ts
+++ b/backend/src/services/telemetry/telemetry-service.ts
@@ -422,6 +422,8 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
const TELEMETRY_IDENTIFY_CACHE_KEY_PREFIX = "telemetry-identify";
const TELEMETRY_IDENTIFY_CACHE_TTL = 86400; // 24 hours
+ // Shorter TTL for in-memory fallback to bound memory growth during Redis outages
+ const IN_MEMORY_IDENTIFY_FALLBACK_TTL_MS = 5 * 60 * 1000; // 5 minutes
// In-memory fallback dedup set to limit blast radius during Redis outages
const inMemoryIdentifyDedup = new Set<string>();
@@ -456,7 +458,7 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
inMemoryIdentifyDedup.add(distinctId);
const timer = setTimeout(
() => inMemoryIdentifyDedup.delete(distinctId),
- TELEMETRY_IDENTIFY_CACHE_TTL * 1000
+ IN_MEMORY_IDENTIFY_FALLBACK_TTL_MS
);
timer.unref();
}
@@ -500,7 +502,7 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
inMemoryIdentityDedup.add(dedupKey);
const timer = setTimeout(
() => inMemoryIdentityDedup.delete(dedupKey),
- KeyStoreTtls.TelemetryIdentifyIdentityInSeconds * 1000
+ IN_MEMORY_IDENTIFY_FALLBACK_TTL_MS
);
timer.unref();
// falls through intentionally: first caller during Redis outage still identifies