Skip to content

Commit

Permalink
chore: pass the --disable-gpu flag in all Chrome templates
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Dec 18, 2024
1 parent daa74a2 commit 56719db
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions templates/js-crawlee-playwright-chrome/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
const crawler = new PlaywrightCrawler({
proxyConfiguration,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--disable-gpu', // Mitigates the "crashing GPU process" issue in Docker containers
]
}
}
});

await crawler.run(startUrls);
Expand Down
7 changes: 7 additions & 0 deletions templates/js-crawlee-puppeteer-chrome/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
const crawler = new PuppeteerCrawler({
proxyConfiguration,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--disable-gpu', // Mitigates the "crashing GPU process" issue in Docker containers
]
}
}
});

// Run the crawler with the start URLs and wait for it to finish.
Expand Down
7 changes: 7 additions & 0 deletions templates/ts-crawlee-playwright-chrome/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ const crawler = new PlaywrightCrawler({
proxyConfiguration,
maxRequestsPerCrawl,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--disable-gpu', // Mitigates the "crashing GPU process" issue in Docker containers
]
}
}
});

await crawler.run(startUrls);
Expand Down
7 changes: 7 additions & 0 deletions templates/ts-crawlee-puppeteer-chrome/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const proxyConfiguration = await Actor.createProxyConfiguration();
const crawler = new PuppeteerCrawler({
proxyConfiguration,
requestHandler: router,
launchContext: {
launchOptions: {
args: [
'--disable-gpu', // Mitigates the "crashing GPU process" issue in Docker containers
]
}
}
});

// Run the crawler with the start URLs and wait for it to finish.
Expand Down

0 comments on commit 56719db

Please sign in to comment.