Skip to content

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

fix: remove INFISICAL_CLOUD comment and wrap Redis counter increments in try-catch

Devin AI3f1317bd84a5
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index ad8790bb50..8351beb41c 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -292,8 +292,6 @@ const envSchema = z
.enum(["true", "false"])
.transform((val) => val === "true" || IS_PACKAGED)
.optional(),
- // Infisical-managed only. Do not set on self-hosted deployments.
- // Used for Cloud and dedicated cloud instances.
INFISICAL_CLOUD: zodStrBool.default("false"),
MAINTENANCE_MODE: zodStrBool.default("false"),
CAPTCHA_SECRET: zpStr(z.string().optional()),
diff --git a/backend/src/services/telemetry/telemetry-service.ts b/backend/src/services/telemetry/telemetry-service.ts
index 2f67922882..0531ed60f8 100644
--- a/backend/src/services/telemetry/telemetry-service.ts
+++ b/backend/src/services/telemetry/telemetry-service.ts
@@ -185,10 +185,6 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
};
const sendPostHogEvents = async (event: TPostHogEvent) => {
- // Track secret operation counters in Redis for TelemetryInstanceStats (non-cloud only).
- // Only increment when a PostHog client is available, since the TelemetryInstanceStats
- // cleanup job that reads and deletes these counters is only scheduled when postHog
- // is defined. Without this gate, counters would accumulate indefinitely in Redis.
if (!appCfg.INFISICAL_CLOUD && postHog) {
if (
[
@@ -198,11 +194,15 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
PostHogEventTypes.SecretUpdated
].includes(event.event)
) {
- await keyStore.incrementBy(
- TELEMETRY_SECRET_PROCESSED_KEY,
- (event as TSecretModifiedEvent).properties.numberOfSecrets
- );
- await keyStore.incrementBy(TELEMETRY_SECRET_OPERATIONS_KEY, 1);
+ try {
+ await keyStore.incrementBy(
+ TELEMETRY_SECRET_PROCESSED_KEY,
+ (event as TSecretModifiedEvent).properties.numberOfSecrets
+ );
+ await keyStore.incrementBy(TELEMETRY_SECRET_OPERATIONS_KEY, 1);
+ } catch (error) {
+ logger.error(error, "Failed to increment telemetry secret counters in Redis");
+ }
}
}