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.

Fixed formatting and typo.

Petr Patek88d1ec9f04c8
diff --git a/src/autoscaling/snapshotter.js b/src/autoscaling/snapshotter.js
index 05c9a50f9..a5be3e12a 100644
--- a/src/autoscaling/snapshotter.js
+++ b/src/autoscaling/snapshotter.js
@@ -247,7 +247,7 @@ class Snapshotter {
if (isCriticalOverload) {
const usedPercentage = usedBytes / this.maxMemoryBytes * 100;
const toMb = bytes => bytes / (1024 ** 2);
- log.warning(`Memory is critical overloaded. Used ${toMb(usedBytes)} MB of ${toMb(this.maxMemoryBytes)} MB (${usedPercentage}%)`);
+ log.warning(`Memory is critically overloaded. Used ${toMb(usedBytes)} MB of ${toMb(this.maxMemoryBytes)} MB (${usedPercentage}%)`);
}
} catch (e) {
log.exception(e, 'Snapshotter: Memory leak warning failed.');
@@ -346,11 +346,8 @@ class Snapshotter {
let oldCount = 0;
for (let i = 0; i < snapshots.length; i++) {
const { createdAt } = snapshots[i];
- if (now - createdAt > this.snapshotHistoryMillis) {
- oldCount++;
- } else {
- break;
- }
+ if (now - createdAt > this.snapshotHistoryMillis) oldCount++;
+ else break;
}
snapshots.splice(0, oldCount);
}