fix api delayed jobs
This commit is contained in:
@@ -267,6 +267,10 @@ export async function postEvent(
|
||||
|
||||
await withTiming('Promote previous job', prevEventJob.promote());
|
||||
}
|
||||
} else if (payload.name !== 'screen_view') {
|
||||
contextLogger.send('no previous job', {
|
||||
prevEventJob,
|
||||
});
|
||||
}
|
||||
|
||||
if (createSessionStart) {
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
import type { TransportTargetOptions } from 'pino';
|
||||
import pino from 'pino';
|
||||
|
||||
const ENABLED = process.env.NODE_ENV === 'production';
|
||||
|
||||
const transport = pino.transport({
|
||||
targets: ENABLED
|
||||
const targets: TransportTargetOptions[] =
|
||||
process.env.NODE_ENV === 'production'
|
||||
? [
|
||||
{
|
||||
target: '@logtail/pino',
|
||||
options: { sourceToken: process.env.BETTERSTACK_TOKEN },
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
target: 'pino-pretty',
|
||||
},
|
||||
]
|
||||
: [],
|
||||
];
|
||||
|
||||
const transport = pino.transport({
|
||||
targets,
|
||||
});
|
||||
|
||||
export const logger = pino(transport);
|
||||
|
||||
Reference in New Issue
Block a user