chore(api): add option to not add new jobs

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-08 22:13:16 +01:00
parent 6cc3bea802
commit 2688a428d9
2 changed files with 52 additions and 46 deletions

View File

@@ -49,6 +49,8 @@ export async function postEvent(
'NX', 'NX',
); );
// TODO: remove this
if (process.env.DISABLE_ADD_JOBS === undefined) {
eventsQueue.add( eventsQueue.add(
'event', 'event',
{ {
@@ -74,6 +76,7 @@ export async function postEvent(
delay: request.body.name === 'screen_view' ? undefined : 1000, delay: request.body.name === 'screen_view' ? undefined : 1000,
}, },
); );
}
reply.status(202).send('ok'); reply.status(202).send('ok');
} }

View File

@@ -247,6 +247,8 @@ async function track({
'NX', 'NX',
); );
// TODO: remove this
if (process.env.DISABLE_ADD_JOBS === undefined) {
eventsQueue.add( eventsQueue.add(
'event', 'event',
{ {
@@ -272,6 +274,7 @@ async function track({
delay: payload.name === 'screen_view' ? undefined : 1000, delay: payload.name === 'screen_view' ? undefined : 1000,
}, },
); );
}
} }
async function identify({ async function identify({