worker log user events

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-14 00:02:50 +01:00
parent f32dc4711a
commit 0bce06119a

View File

@@ -27,6 +27,18 @@ export async function createSessionEnd(
job.log(sql);
const events = await getEvents(sql);
events.map((event, index) => {
job.log(
[
`Index: ${index}`,
`Event: ${event.name}`,
`Created: ${event.createdAt.toISOString()}`,
`Profile: ${event.profileId}`,
`Path: ${event.path}`,
].join('\n')
);
});
const sessionDuration = events.reduce((acc, event) => {
return acc + event.duration;
}, 0);