minor worker fix

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-11 22:34:11 +02:00
parent 45a1e88216
commit 6934959d5b
2 changed files with 5 additions and 4 deletions

View File

@@ -47,10 +47,7 @@ export async function incomingEvent(job: Job<EventsQueuePayloadIncomingEvent>) {
};
// this will get the profileId from the alias table if it exists
const profileId = await getProfileIdCached({
profileId: body.profileId,
projectId,
});
const profileId = body.profileId ?? '';
const createdAt = new Date(body.timestamp);
const url = getProperty('__path');
const { path, hash, query, origin } = parsePath(url);

View File

@@ -459,6 +459,10 @@ export async function getLastScreenViewFromProfileId({
profileId: string;
projectId: string;
}) {
if (!profileId) {
return null;
}
const eventInBuffer = await eventBuffer.find(
(item) => item.event.profile_id === profileId
);