Conversation
…er empty string as infinity
| describe('Actor.config and PPE', () => { | ||
| test('should work', async () => { | ||
| await Actor.init(); | ||
| process.env.ACTOR_MAX_TOTAL_CHARGE_USD = ''; |
There was a problem hiding this comment.
What about this case: process.env.ACTOR_MAX_TOTAL_CHARGE_USD = '0';? In that case we probably don't want to coerce to Infinity...
There was a problem hiding this comment.
@mhamas thoughts? it sounds fine to me, 0 is often considered to be infinity.
if we want to distinguish empty string and zero, we'd have to adjust the logic in the config class a bit (and that would first need to happen in crawlee, but we can hotfix it from the SDK too now so we are not blocked by the crawlee release). i guess it would be fine if we just check for the empty string and map the value to undefined.
There was a problem hiding this comment.
0 is not a valid value for the total max. I think coercing to infinity is fine in that case.
| describe('Actor.config and PPE', () => { | ||
| test('should work', async () => { | ||
| await Actor.init(); | ||
| process.env.ACTOR_MAX_TOTAL_CHARGE_USD = ''; |
There was a problem hiding this comment.
0 is not a valid value for the total max. I think coercing to infinity is fine in that case.
The
ACTOR_MAX_TOTAL_CHARGE_USDenv var wasnt properly marked as integer, and the fallback to infinity wasn't working in case the value was an empty string, since??fallbacks only for null/undefined values.