fix cleanup base64 sse

This commit is contained in:
Vikhyath Mondreti
2026-02-04 09:05:48 -08:00
parent e63a642f11
commit eff4fc922b

View File

@@ -458,8 +458,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
})
await loggingSession.markAsFailed(timeoutErrorMessage)
await cleanupExecutionBase64Cache(executionId)
return NextResponse.json(
{
success: false,
@@ -487,9 +485,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
const resultWithBase64 = { ...result, output: outputWithBase64 }
// Cleanup base64 cache for this execution
await cleanupExecutionBase64Cache(executionId)
const hasResponseBlock = workflowHasResponseBlock(resultWithBase64)
if (hasResponseBlock) {
return createHttpResponseFromBlock(resultWithBase64)
@@ -539,6 +534,13 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
)
} finally {
timeoutController.cleanup()
if (executionId) {
try {
await cleanupExecutionBase64Cache(executionId)
} catch (error) {
logger.error(`[${requestId}] Failed to cleanup base64 cache`, { error })
}
}
}
}