perf(worker): try to improve perf of worker

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-24 09:19:30 +02:00
parent a1278ca371
commit 25a7365569
6 changed files with 425 additions and 359 deletions

View File

@@ -588,9 +588,10 @@ export async function getLastScreenViewFromProfileId({
return null;
}
const eventInBuffer = await eventBuffer.find(
(item) => item.profile_id === profileId,
);
const eventInBuffer = await eventBuffer.getLastScreenView({
projectId,
profileId,
});
if (eventInBuffer) {
return eventInBuffer;