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.

fix: Use the correct mutex in memory storage RequestQueueClient (#2623)

Jan Buchar2fa8a29b8156
diff --git a/packages/memory-storage/src/resource-clients/request-queue.ts b/packages/memory-storage/src/resource-clients/request-queue.ts
index 8f09c80e7..0127ec3e9 100644
--- a/packages/memory-storage/src/resource-clients/request-queue.ts
+++ b/packages/memory-storage/src/resource-clients/request-queue.ts
@@ -214,7 +214,7 @@ export class RequestQueueClient extends BaseClient implements storage.RequestQue
const items = [];
- await this.mutex.wait();
+ await queue.mutex.wait();
try {
for (const storageEntry of queue.requests.values()) {
@@ -248,7 +248,7 @@ export class RequestQueueClient extends BaseClient implements storage.RequestQue
items: items.map(({ json }) => this._jsonToRequest(json)!),
};
} finally {
- this.mutex.shift();
+ queue.mutex.shift();
}
}