Increase PDF generation timeout and use networkidle2
This commit is contained in:
parent
51ac30cbc4
commit
b60d3a89ca
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue