Skip to content

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

fix: use awaitable _shutdown() for graceful flush in posthog-node v5

Devin AI9174c5527f03
diff --git a/backend/src/services/telemetry/telemetry-service.ts b/backend/src/services/telemetry/telemetry-service.ts
index 31dd28a1d8..db3b8757d0 100644
--- a/backend/src/services/telemetry/telemetry-service.ts
+++ b/backend/src/services/telemetry/telemetry-service.ts
@@ -343,7 +343,9 @@ To opt into telemetry, you can set "TELEMETRY_ENABLED=true" within the environme
const flushAll = async () => {
if (postHog) {
- postHog.shutdown();
+ // posthog-node v5: shutdown() is fire-and-forget (returns void).
+ // Use _shutdown() to await flush completion during graceful shutdown.
+ await postHog._shutdown();
}
};