improve(api): ensure we do 3 attempts to add events to the queue

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-19 10:34:52 +01:00
parent 59012526e2
commit 6ad47c8bd1
3 changed files with 17 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ export async function postEvent(
'NX',
);
eventsQueue.add(
await eventsQueue.add(
'event',
{
type: 'incomingEvent',
@@ -68,6 +68,11 @@ export async function postEvent(
},
},
{
attempts: 3,
backoff: {
type: 'exponential',
delay: 200,
},
// Prioritize 'screen_view' events by setting no delay
// This ensures that session starts are created from 'screen_view' events
// rather than other events, maintaining accurate session tracking