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