Increase PDF generation timeout and use networkidle2

This commit is contained in:
Colin 2025-12-11 13:17:28 -05:00
parent 51ac30cbc4
commit b60d3a89ca
Signed by: colin
SSH Key Fingerprint: SHA256:nRPCQTeMFLdGytxRQmPVK9VXY3/ePKQ5lGRyJhT5DY8
1 changed files with 5 additions and 5 deletions

View File

@ -118,8 +118,8 @@ async function generatePdf(browser, htmlFile) {
try { try {
// Navigate to the page and wait for content to load // Navigate to the page and wait for content to load
await page.goto(url, { await page.goto(url, {
waitUntil: 'networkidle0', waitUntil: 'networkidle2',
timeout: 30000 timeout: 60000
}); });
// Wait for includes.js to finish loading header and footer // Wait for includes.js to finish loading header and footer
@ -146,7 +146,7 @@ async function generatePdf(browser, htmlFile) {
return true; return true;
}, { }, {
timeout: 15000, timeout: 30000,
polling: 100 // Check every 100ms polling: 100 // Check every 100ms
}); });
} catch (waitError) { } catch (waitError) {
@ -192,8 +192,8 @@ async function generatePdf(browser, htmlFile) {
// Re-navigate to the page if it was closed // Re-navigate to the page if it was closed
try { try {
await page.goto(url, { await page.goto(url, {
waitUntil: 'networkidle0', waitUntil: 'networkidle2',
timeout: 30000 timeout: 60000
}); });
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
} catch (navError) { } catch (navError) {