apify 4.0.0-beta.112 → 4.0.0-beta.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/charging.js +13 -5
  2. package/package.json +1 -1
package/dist/charging.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Dataset, KeyValueStore } from '@crawlee/core';
2
+ import { META_ORIGINS } from '@apify/consts';
2
3
  import log from '@apify/log';
3
4
  import { ReentrantAsyncLock } from './utils.js';
4
5
  /** How long a charge is remembered by its idempotency key - the same as the platform's own records. */
@@ -63,11 +64,18 @@ export class ChargingManager {
63
64
  }
64
65
  async fetchPricingInfo() {
65
66
  if (this.#configuration.actorPricingInfo && this.#configuration.chargedEventCounts) {
66
- return {
67
- pricingInfo: JSON.parse(this.#configuration.actorPricingInfo),
68
- chargedEventCounts: JSON.parse(this.#configuration.chargedEventCounts),
69
- maxTotalChargeUsd: this.#configuration.maxTotalChargeUsd || Infinity,
70
- };
67
+ const pricingInfo = JSON.parse(this.#configuration.actorPricingInfo);
68
+ // Multi-tenant runs get an empty snapshot (`{}`); only the run tells them apart from free Server Actor runs.
69
+ const isMultiTenantCandidate = pricingInfo.pricingModel === undefined &&
70
+ this.#isAtHome &&
71
+ this.#configuration.metaOrigin === META_ORIGINS.STANDBY;
72
+ if (!isMultiTenantCandidate) {
73
+ return {
74
+ pricingInfo,
75
+ chargedEventCounts: JSON.parse(this.#configuration.chargedEventCounts),
76
+ maxTotalChargeUsd: this.#configuration.maxTotalChargeUsd || Infinity,
77
+ };
78
+ }
71
79
  }
72
80
  if (this.#isAtHome) {
73
81
  if (this.#actorRunId === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify",
3
- "version": "4.0.0-beta.112",
3
+ "version": "4.0.0-beta.113",
4
4
  "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.",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"