(maxAttempts int, path string, allowZeroDefault bool)
| 1294 | } |
| 1295 | |
| 1296 | func validateTaskMaxAttempts(maxAttempts int, path string, allowZeroDefault bool) error { |
| 1297 | if allowZeroDefault && maxAttempts == 0 { |
| 1298 | return nil |
| 1299 | } |
| 1300 | if maxAttempts <= 0 { |
| 1301 | return fmt.Errorf("%w: %s must be positive: %d", ErrValidation, path, maxAttempts) |
| 1302 | } |
| 1303 | if maxAttempts > MaxTaskMaxAttempts { |
| 1304 | return fmt.Errorf("%w: %s must be <= %d: %d", ErrValidation, path, MaxTaskMaxAttempts, maxAttempts) |
| 1305 | } |
| 1306 | return nil |
| 1307 | } |
| 1308 | |
| 1309 | func normalizeApprovalPolicyOrDefault(policy ApprovalPolicy) ApprovalPolicy { |
| 1310 | normalized := policy.Normalize() |
no outgoing calls
no test coverage detected