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.