Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 8 package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 4 packages/apify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"@crawlee/core": "^3.9.0",
"@crawlee/types": "^3.9.0",
"@crawlee/utils": "^3.9.0",
"apify-client": "^2.9.0",
"apify-client": "^2.10.0",
"fs-extra": "^11.2.0",
"ow": "^0.28.2",
"semver": "^7.5.4",
"tslib": "^2.6.2",
"ws": "^8.18.0"
}
}
}
6 changes: 4 additions & 2 deletions 6 packages/apify/src/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { KeyValueStore } from './key_value_store';
import { PlatformEventManager } from './platform_event_manager';
import type { ProxyConfigurationOptions } from './proxy_configuration';
import { ProxyConfiguration } from './proxy_configuration';
import { checkCrawleeVersion, logSystemInfo, printOutdatedSdkWarning } from './utils';
import { checkCrawleeVersion, getSystemInfo, printOutdatedSdkWarning } from './utils';

/**
* `Actor` class serves as an alternative approach to the static helpers exported from the package. It allows to pass configuration
Expand Down Expand Up @@ -191,7 +191,7 @@ export class Actor<Data extends Dictionary = Dictionary> {
this.initialized = true;

checkCrawleeVersion();
logSystemInfo();
log.info('System info', getSystemInfo());
printOutdatedSdkWarning();

// reset global config instance to respect APIFY_ prefixed env vars
Expand Down Expand Up @@ -938,9 +938,11 @@ export class Actor<Data extends Dictionary = Dictionary> {
*/
newClient(options: ApifyClientOptions = {}): ApifyClient {
const { storageDir, ...storageClientOptions } = this.config.get('storageClientOptions') as Dictionary;
const { apifyVersion, crawleeVersion } = getSystemInfo();
return new ApifyClient({
baseUrl: this.config.get('apiBaseUrl'),
token: this.config.get('token'),
userAgentSuffix: [`SDK/${apifyVersion}`, `Crawlee/${crawleeVersion}`],
...storageClientOptions,
...options, // allow overriding the instance configuration
});
Expand Down
9 changes: 4 additions & 5 deletions 9 packages/apify/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ import semver from 'semver';
import { version as apifyVersion } from '../package.json';

/**
* Logs info about system, node version and apify package version.
* Gets info about system, node version and apify package version.
* @internal
*/
export function logSystemInfo() {
log.info('System info', {
export function getSystemInfo() {
return {
apifyVersion,
apifyClientVersion,
crawleeVersion,
osType: type(),
nodeVersion: process.version,
});
};
}

/**
* Logs info about system, node version and apify package version.
* @internal
*/
export function checkCrawleeVersion() {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.