Skip to content

Commit eff4fc9

Browse files
committed
fix cleanup base64 sse
1 parent e63a642 commit eff4fc9

File tree

1 file changed

+7
-5
lines changed
  • apps/sim/app/api/workflows/[id]/execute

1 file changed

+7
-5
lines changed

apps/sim/app/api/workflows/[id]/execute/route.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
458458
})
459459
await loggingSession.markAsFailed(timeoutErrorMessage)
460460

461-
await cleanupExecutionBase64Cache(executionId)
462-
463461
return NextResponse.json(
464462
{
465463
success: false,
@@ -487,9 +485,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
487485

488486
const resultWithBase64 = { ...result, output: outputWithBase64 }
489487

490-
// Cleanup base64 cache for this execution
491-
await cleanupExecutionBase64Cache(executionId)
492-
493488
const hasResponseBlock = workflowHasResponseBlock(resultWithBase64)
494489
if (hasResponseBlock) {
495490
return createHttpResponseFromBlock(resultWithBase64)
@@ -539,6 +534,13 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
539534
)
540535
} finally {
541536
timeoutController.cleanup()
537+
if (executionId) {
538+
try {
539+
await cleanupExecutionBase64Cache(executionId)
540+
} catch (error) {
541+
logger.error(`[${requestId}] Failed to cleanup base64 cache`, { error })
542+
}
543+
}
542544
}
543545
}
544546

0 commit comments

Comments
 (0)