Description
Make the retry option optional and fix the retry forever behavior.
Current Behavior
max_retries is a u32 field
max_retries == 0 means retry forever (logically incorrect)
- Default is 3 retries
Desired Behavior
- Make
max_retries an Option<u32> field
- If
max_retries is None (not set), the activity should retry forever
- If
max_retries is Some(0), the activity should not retry (0 means no retry)
- If
max_retries is Some(n) where n > 0, the activity should retry up to n times
Rationale
The current logic where 0 == retry forever is counterintuitive. The new approach is more logical:
None = retry forever (unlimited)
Some(0) = no retry
Some(n) = retry up to n times
Implementation Notes
- Update
ActivityOption.max_retries from u32 to Option<u32>
- Update
Activity.max_retries from u32 to Option<u32>
- Update the retry logic in
src/queue/queue.rs (around line 1187) to check for None (retry forever) instead of 0
- Update default behavior to use
None for retry forever instead of 3
Description
Make the retry option optional and fix the retry forever behavior.
Current Behavior
max_retriesis au32fieldmax_retries == 0means retry forever (logically incorrect)Desired Behavior
max_retriesanOption<u32>fieldmax_retriesisNone(not set), the activity should retry forevermax_retriesisSome(0), the activity should not retry (0 means no retry)max_retriesisSome(n)wheren > 0, the activity should retry up tontimesRationale
The current logic where
0 == retry foreveris counterintuitive. The new approach is more logical:None= retry forever (unlimited)Some(0)= no retrySome(n)= retry up to n timesImplementation Notes
ActivityOption.max_retriesfromu32toOption<u32>Activity.max_retriesfromu32toOption<u32>src/queue/queue.rs(around line 1187) to check forNone(retry forever) instead of0Nonefor retry forever instead of3