@crawlee/core
Advanced tools
Comparing version 3.0.0-alpha.42 to 3.0.0-alpha.43
@@ -0,1 +1,2 @@ | ||
import { KeyValueStore } from '../storages/key_value_store'; | ||
import { Configuration } from '../configuration'; | ||
@@ -37,3 +38,3 @@ /** | ||
readonly requestRetryHistogram: number[]; | ||
private keyValueStore; | ||
private keyValueStore?; | ||
private persistStateKey; | ||
@@ -111,2 +112,3 @@ private logIntervalMillis; | ||
logMessage?: string; | ||
keyValueStore?: KeyValueStore; | ||
config?: Configuration; | ||
@@ -113,0 +115,0 @@ } |
@@ -5,3 +5,2 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
/* eslint-disable max-classes-per-file */ | ||
const ow_1 = tslib_1.__importDefault(require("ow")); | ||
@@ -93,3 +92,3 @@ const log_1 = require("../log"); | ||
writable: true, | ||
value: null | ||
value: undefined | ||
}); | ||
@@ -153,7 +152,9 @@ Object.defineProperty(this, "persistStateKey", { | ||
logMessage: ow_1.default.optional.string, | ||
keyValueStore: ow_1.default.optional.object, | ||
config: ow_1.default.optional.object, | ||
})); | ||
const { logIntervalSecs = 60, logMessage = 'Statistics', config = configuration_1.Configuration.getGlobalConfig(), } = options; | ||
const { logIntervalSecs = 60, logMessage = 'Statistics', keyValueStore, config = configuration_1.Configuration.getGlobalConfig(), } = options; | ||
this.logIntervalMillis = logIntervalSecs * 1000; | ||
this.logMessage = logMessage; | ||
this.keyValueStore = keyValueStore; | ||
this.listener = this.persistState.bind(this); | ||
@@ -252,3 +253,3 @@ this.events = config.getEventManager(); | ||
async startCapturing() { | ||
this.keyValueStore = await key_value_store_1.KeyValueStore.open(); | ||
this.keyValueStore ?? (this.keyValueStore = await key_value_store_1.KeyValueStore.open()); | ||
await this._maybeLoadStatistics(); | ||
@@ -255,0 +256,0 @@ if (this.state.crawlerStartedAt === null) { |
@@ -5,3 +5,2 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
// eslint-disable-next-line max-classes-per-file | ||
const os_1 = tslib_1.__importDefault(require("os")); | ||
@@ -8,0 +7,0 @@ const log_1 = tslib_1.__importDefault(require("@apify/log")); |
{ | ||
"name": "@crawlee/core", | ||
"version": "3.0.0-alpha.42", | ||
"version": "3.0.0-alpha.43", | ||
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.", | ||
@@ -52,3 +52,3 @@ "engines": { | ||
"dependencies": { | ||
"@apify/consts": "^1.4.2", | ||
"@apify/consts": "^1.7.0", | ||
"@apify/datastructures": "^1.0.1", | ||
@@ -58,15 +58,12 @@ "@apify/log": "^1.2.0", | ||
"@apify/timeout": "^0.2.1", | ||
"@apify/utilities": "^1.2.5", | ||
"@crawlee/browser-pool": "^3.0.0-alpha.42", | ||
"@crawlee/utils": "^3.0.0-alpha.42", | ||
"@crawlee/memory-storage": "^3.0.0-alpha.42", | ||
"got-scraping": "^3.2.7", | ||
"@crawlee/browser-pool": "^3.0.0-alpha.43", | ||
"@crawlee/memory-storage": "^3.0.0-alpha.43", | ||
"iconv-lite": "^0.6.3", | ||
"minimatch": "^5.0.1", | ||
"ow": "^0.28.0", | ||
"stream-json": "^1.7.3", | ||
"ow": "^0.28.1", | ||
"stream-json": "^1.7.4", | ||
"tldts": "^5.7.69", | ||
"tough-cookie": "^4.0.0", | ||
"ws": "^7.5.3" | ||
"ws": "^7.5.7" | ||
} | ||
} |
@@ -21,2 +21,4 @@ # Crawlee: The scalable web crawling and scraping library for JavaScript | ||
> Would you like to work with us on Apify SDK or similar projects? [We are hiring!](https://apify.com/jobs#senior-node.js-engineer) | ||
## Motivation | ||
@@ -23,0 +25,0 @@ |
@@ -600,3 +600,3 @@ "use strict"; | ||
// Skip requests with duplicate uniqueKey | ||
if (!this.uniqueKeyToIndex.hasOwnProperty(uniqueKey)) { // eslint-disable-line no-prototype-builtins | ||
if (!this.uniqueKeyToIndex.hasOwnProperty(uniqueKey)) { | ||
this.uniqueKeyToIndex[uniqueKey] = this.requests.length; | ||
@@ -606,3 +606,3 @@ this.requests.push(request); | ||
else if (this.keepDuplicateUrls) { | ||
this.log.warning(`Duplicate uniqueKey: ${uniqueKey} found while the keepDuplicateUrls option was set. Check your sources' unique keys.`); // eslint-disable-line max-len | ||
this.log.warning(`Duplicate uniqueKey: ${uniqueKey} found while the keepDuplicateUrls option was set. Check your sources' unique keys.`); | ||
} | ||
@@ -609,0 +609,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
683701
14
9984
217
- Removed@apify/utilities@^1.2.5
- Removed@crawlee/utils@^3.0.0-alpha.42
- Removedgot-scraping@^3.2.7
- Removed@apify/utilities@1.2.14(transitive)
- Removed@szmarczak/http-timer@4.0.6(transitive)
- Removed@types/responselike@1.0.0(transitive)
- Removedcacheable-lookup@6.1.0(transitive)
- Removedcacheable-request@7.0.2(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedform-data-encoder@1.7.2(transitive)
- Removedget-stream@5.2.06.0.1(transitive)
- Removedgot-cjs@12.5.4(transitive)
- Removedgot-scraping@3.2.15(transitive)
- Removedlowercase-keys@2.0.0(transitive)
- Removedmimic-response@1.0.1(transitive)
- Removednormalize-url@6.1.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-cancelable@2.1.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedresponselike@2.0.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updated@apify/consts@^1.7.0
Updatedow@^0.28.1
Updatedstream-json@^1.7.4
Updatedws@^7.5.7