Skip to content

calculate_max_event_charge_count_within_limit doesn't do it's job when pushing data to default dataset in PPE actor #705

@devsaswave

Description

@devsaswave

Currently when testing a user providing Maximum cost per run to an PPE actor run (not input but env variable seen from actor side)

EVENT_NAME = "apify-default-dataset-item"

async with Actor:
  charging_manager = Actor.get_charging_manager()
  remaining = charging_manager.calculate_max_event_charge_count_within_limit(EVENT_NAME)
  await Actor.push_data({"test":"Yes"})
  remaining = charging_manager.calculate_max_event_charge_count_within_limit(EVENT_NAME)
  await Actor.push_data({"test":"Yes"})
  remaining = charging_manager.calculate_max_event_charge_count_within_limit(EVENT_NAME)

remaining is always the same

Unless if i do

await Actor.push_data({"test":"Yes"}, EVENT_NAME)

Then calculate_max_event_charge_count_within_limit() works corretly
But i have to catch and ignore the error raised by push_data() because as mentioned in the logs

apify_client._errors.ApifyApiError: Event "apify-default-dataset-item" is system event and cannot be charged.

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions