Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore: use `handleRequestTimeoutMillis * 2` when computing internal timeout value

Martin Adámek4f54355f8574
diff --git a/src/crawlers/basic_crawler.js b/src/crawlers/basic_crawler.js
index 904b38779..3135c4fd2 100644
--- a/src/crawlers/basic_crawler.js
+++ b/src/crawlers/basic_crawler.js
@@ -264,7 +264,7 @@ export class BasicCrawler {
this.handleRequestTimeoutMillis = handleRequestTimeoutSecs * 1000;
const tryEnv = (val) => (val == null ? val : +val);
// allow at least 5min for internal timeouts
- this.internalTimeoutMillis = tryEnv(process.env.APIFY_INTERNAL_TIMEOUT) ?? Math.max(this.handleRequestTimeoutMillis, 300e3);
+ this.internalTimeoutMillis = tryEnv(process.env.APIFY_INTERNAL_TIMEOUT) ?? Math.max(this.handleRequestTimeoutMillis * 2, 300e3);
// override the default internal timeout of request queue to respect `handleRequestTimeoutMillis`
if (this.requestQueue) {
this.requestQueue.internalTimeoutMillis = this.internalTimeoutMillis;