I'm using the following, but surely it should happen by default?
function runAfter(ctx: ExecutionContext, promise: Promise<unknown>) {
ctx.waitUntil(wrapLogfire(promise))
}
async function wrapLogfire(promise: Promise<unknown>): Promise<void> {
try {
await promise
} catch (error) {
logfire.reportError('Error in ctx.waitUntil', error as Error)
throw error
}
}
I'm using the following, but surely it should happen by default?