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.

Adding setMin/MaxConcurrency()

Marek Trunkat284f5a8b5770
diff --git a/src/autoscaling/autoscaled_pool.js b/src/autoscaling/autoscaled_pool.js
index d1b53c8a5..22bb3156b 100644
--- a/src/autoscaling/autoscaled_pool.js
+++ b/src/autoscaling/autoscaled_pool.js
@@ -173,6 +173,24 @@ class AutoscaledPool {
this.systemStatus = new SystemStatus(ssoCopy);
}
+ /**
+ * Overrides max concurrency configuration.
+ *
+ * @param {Number} maxConcurrency
+ */
+ setMaxConcurrency(maxConcurrency) {
+ this.maxConcurrency = maxConcurrency;
+ }
+
+ /**
+ * Overrides min concurrency configuration.
+ *
+ * @param {Number} minConcurrency
+ */
+ setMinConcurrency(minConcurrency) {
+ this.minConcurrency = minConcurrency;
+ }
+
/**
* Runs the auto-scaled pool. Returns a promise that gets resolved or rejected once
* all the tasks are finished or one of them fails.