Skip to content

Commit dd4014d

Browse files
fix
1 parent f04ecab commit dd4014d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/backend/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { RepoPermissionSyncer } from './ee/repoPermissionSyncer.js';
1414
import { AccountPermissionSyncer } from "./ee/accountPermissionSyncer.js";
1515
import { PromClient } from './promClient.js';
1616
import { RepoIndexManager } from "./repoIndexManager.js";
17+
import { shutdownPosthog } from "./posthog.js";
1718

1819

1920
const logger = createLogger('backend-entrypoint');
@@ -101,6 +102,7 @@ const cleanup = async (signal: string) => {
101102

102103
await prisma.$disconnect();
103104
await redis.quit();
105+
await shutdownPosthog();
104106
}
105107

106108
process.on('SIGINT', () => cleanup('SIGINT').finally(() => process.exit(0)));

packages/backend/src/posthog.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ export function captureEvent<E extends PosthogEvent>(event: E, properties: Posth
2929
});
3030
}
3131

32-
await posthog?.shutdown();
32+
export async function shutdownPosthog() {
33+
await posthog?.shutdown();
34+
}

0 commit comments

Comments
 (0)