Skip to content

Commit 9f81e89

Browse files
authored
Merge pull request #657 from trycompai/codex/replace-shutdown-with-flush-in-server-ts
Fix analytics lifecycle
2 parents 29785d9 + 42ec348 commit 9f81e89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/analytics/src/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function track(distinctId: string, eventName: string, properties?:
2929
event: eventName,
3030
properties,
3131
});
32-
await serverInstance.shutdown();
32+
await serverInstance.flush();
3333
}
3434

3535
export async function identify(distinctId: string, properties?: Properties) {
@@ -39,13 +39,13 @@ export async function identify(distinctId: string, properties?: Properties) {
3939
distinctId,
4040
properties,
4141
});
42-
await serverInstance.shutdown();
42+
await serverInstance.flush();
4343
}
4444

4545
export async function getFeatureFlags(distinctId: string) {
4646
if (!serverInstance) return {};
4747

4848
const flags = await serverInstance.getAllFlags(distinctId);
49-
await serverInstance.shutdown();
49+
await serverInstance.flush();
5050
return flags;
51-
}
51+
}

0 commit comments

Comments
 (0)