This commit is contained in:
bkellam 2025-11-09 14:01:24 -08:00
parent f04ecab3ad
commit dd4014d48e
2 changed files with 5 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import { RepoPermissionSyncer } from './ee/repoPermissionSyncer.js';
import { AccountPermissionSyncer } from "./ee/accountPermissionSyncer.js"; import { AccountPermissionSyncer } from "./ee/accountPermissionSyncer.js";
import { PromClient } from './promClient.js'; import { PromClient } from './promClient.js';
import { RepoIndexManager } from "./repoIndexManager.js"; import { RepoIndexManager } from "./repoIndexManager.js";
import { shutdownPosthog } from "./posthog.js";
const logger = createLogger('backend-entrypoint'); const logger = createLogger('backend-entrypoint');
@ -101,6 +102,7 @@ const cleanup = async (signal: string) => {
await prisma.$disconnect(); await prisma.$disconnect();
await redis.quit(); await redis.quit();
await shutdownPosthog();
} }
process.on('SIGINT', () => cleanup('SIGINT').finally(() => process.exit(0))); process.on('SIGINT', () => cleanup('SIGINT').finally(() => process.exit(0)));

View file

@ -29,4 +29,6 @@ export function captureEvent<E extends PosthogEvent>(event: E, properties: Posth
}); });
} }
await posthog?.shutdown(); export async function shutdownPosthog() {
await posthog?.shutdown();
}