@@ -348,10 +348,10 @@ export async function createStreamingResponse(
348348 controller . enqueue ( encodeSSE ( '[DONE]' ) )
349349
350350 if ( executionId ) {
351- await Promise . allSettled ( [
352- cleanupExecutionBase64Cache ( executionId ) ,
353- cleanupPaginatedCache ( executionId ) ,
354- ] )
351+ await cleanupExecutionBase64Cache ( executionId )
352+ void cleanupPaginatedCache ( executionId ) . catch ( ( error ) => {
353+ logger . error ( 'Failed to cleanup paginated cache' , { executionId, error } )
354+ } )
355355 }
356356
357357 controller . close ( )
@@ -362,10 +362,10 @@ export async function createStreamingResponse(
362362 )
363363
364364 if ( executionId ) {
365- await Promise . allSettled ( [
366- cleanupExecutionBase64Cache ( executionId ) ,
367- cleanupPaginatedCache ( executionId ) ,
368- ] )
365+ await cleanupExecutionBase64Cache ( executionId )
366+ void cleanupPaginatedCache ( executionId ) . catch ( ( error ) => {
367+ logger . error ( 'Failed to cleanup paginated cache' , { executionId, error } )
368+ } )
369369 }
370370
371371 controller . close ( )
@@ -378,10 +378,14 @@ export async function createStreamingResponse(
378378 timeoutController . abort ( )
379379 timeoutController . cleanup ( )
380380 if ( executionId ) {
381- await Promise . allSettled ( [
382- cleanupExecutionBase64Cache ( executionId ) ,
383- cleanupPaginatedCache ( executionId ) ,
384- ] )
381+ try {
382+ await cleanupExecutionBase64Cache ( executionId )
383+ } catch ( error ) {
384+ logger . error ( `[${ requestId } ] Failed to cleanup base64 cache` , { error } )
385+ }
386+ void cleanupPaginatedCache ( executionId ) . catch ( ( error ) => {
387+ logger . error ( 'Failed to cleanup paginated cache' , { executionId, error } )
388+ } )
385389 }
386390 } ,
387391 } )
0 commit comments