From 2a7c25f4cdfa88ec7ed91d3b62621b27547d9bb4 Mon Sep 17 00:00:00 2001 From: bravo-kernel Date: Tue, 24 Dec 2024 13:02:26 +0100 Subject: [PATCH] Replace deprecated abortDelay with streamTimeout --- app/entry.server.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/entry.server.tsx b/app/entry.server.tsx index aa14917..94ef27d 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -9,7 +9,8 @@ import i18n from "./localization/i18n" // your i18n configuration file import i18nextOpts from "./localization/i18n.server" import { resources } from "./localization/resource" -const ABORT_DELAY = 5000 +// Reject all pending promises from handler functions after 10 seconds +export const streamTimeout = 10000 export default async function handleRequest( request: Request, @@ -38,7 +39,7 @@ export default async function handleRequest( const { pipe, abort } = renderToPipeableStream( - + , { [callbackName]: () => { @@ -67,6 +68,8 @@ export default async function handleRequest( } ) - setTimeout(abort, ABORT_DELAY) + // Abort the streaming render pass after 11 seconds so to allow the rejected + // boundaries to be flushed + setTimeout(abort, streamTimeout + 1000) }) }