Pre-launch Chromium on server startup to avoid cold-start blocking
Chromium cold launch takes several seconds and blocks the event loop, preventing SSE events from flushing. Now the browser is warmed up during server startup if any store uses render_js, so the first search doesn't pay the launch penalty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,6 +116,12 @@ export async function scrapeStoreWithBrowser(store: Store, searchUrl: string): P
|
||||
}
|
||||
}
|
||||
|
||||
export async function warmupBrowser(): Promise<void> {
|
||||
log('Warming up browser...');
|
||||
await getBrowser();
|
||||
log('Browser ready');
|
||||
}
|
||||
|
||||
export async function closeBrowser(): Promise<void> {
|
||||
if (browser) {
|
||||
await browser.close();
|
||||
|
||||
Reference in New Issue
Block a user