mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
fix(worker): properly shutdown PostHog client (#609)
This commit is contained in:
parent
f04ecab3ad
commit
1be6e8842e
3 changed files with 8 additions and 1 deletions
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Fixed incorrect shutdown of PostHog SDK in the worker. [#609](https://github.com/sourcebot-dev/sourcebot/pull/609)
|
||||
|
||||
## [4.9.1] - 2025-11-07
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { RepoPermissionSyncer } from './ee/repoPermissionSyncer.js';
|
|||
import { AccountPermissionSyncer } from "./ee/accountPermissionSyncer.js";
|
||||
import { PromClient } from './promClient.js';
|
||||
import { RepoIndexManager } from "./repoIndexManager.js";
|
||||
import { shutdownPosthog } from "./posthog.js";
|
||||
|
||||
|
||||
const logger = createLogger('backend-entrypoint');
|
||||
|
|
@ -101,6 +102,7 @@ const cleanup = async (signal: string) => {
|
|||
|
||||
await prisma.$disconnect();
|
||||
await redis.quit();
|
||||
await shutdownPosthog();
|
||||
}
|
||||
|
||||
process.on('SIGINT', () => cleanup('SIGINT').finally(() => process.exit(0)));
|
||||
|
|
|
|||
|
|
@ -29,4 +29,6 @@ export function captureEvent<E extends PosthogEvent>(event: E, properties: Posth
|
|||
});
|
||||
}
|
||||
|
||||
await posthog?.shutdown();
|
||||
export async function shutdownPosthog() {
|
||||
await posthog?.shutdown();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue