Skip to content

Commit 7b75f15

Browse files
committed
clean up base 64 cache correctly
1 parent 7d28f62 commit 7b75f15

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,8 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
596596
}
597597
}
598598

599+
const shouldCleanupBase64 = true
600+
599601
try {
600602
const startTime = new Date()
601603

@@ -866,9 +868,6 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
866868
endTime: result.metadata?.endTime || new Date().toISOString(),
867869
},
868870
})
869-
870-
// Cleanup base64 cache for this execution
871-
await cleanupExecutionBase64Cache(executionId)
872871
} catch (error: unknown) {
873872
const isTimeout = isTimeoutError(error) || timeoutController.isTimedOut()
874873
const errorMessage = isTimeout
@@ -902,6 +901,9 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
902901
})
903902
} finally {
904903
timeoutController.cleanup()
904+
if (executionId && shouldCleanupBase64) {
905+
await cleanupExecutionBase64Cache(executionId)
906+
}
905907
if (!isStreamClosed) {
906908
try {
907909
controller.enqueue(encoder.encode('data: [DONE]\n\n'))

0 commit comments

Comments
 (0)