feat: wait for 15s before execute the keepAlive strategy

This commit is contained in:
2025-04-12 21:48:25 +07:00
parent 65d801b248
commit 27b4f4a9cc

View File

@ -24,6 +24,8 @@ async function spawn(context: BrowserContext, targetUrl: string) {
} }
await targetInput.fill(targetUrl); await targetInput.fill(targetUrl);
await targetInput.press("Enter"); await targetInput.press("Enter");
logger.info(`[${spawnId}] Navigating to ${targetUrl}`);
await page.waitForTimeout(15000); // Wait for 15 second to let the page load
// Keep-alive the page open for 5 minutes then refresh // Keep-alive the page open for 5 minutes then refresh
if (targetUrl.startsWith("https://www.twitch.tv/")) { if (targetUrl.startsWith("https://www.twitch.tv/")) {
await twitch.keepAlive(page, spawnId); await twitch.keepAlive(page, spawnId);