Files
Yeuoly 23a4662e65 feat: add retry mechanism for serverless invocation on 502 errors (#569)
* feat: add retry mechanism for serverless invocation on 502 errors

- Add MAX_SERVERLESS_RETRY_TIMES config (default: 3) for configurable retry attempts
- Implement exponential backoff retry logic (500ms, 1s, 2s, ...) for 502 Bad Gateway errors
- Only retry on 502 status code as it indicates transient AWS Lambda gateway issues
- Add comprehensive test suite with 11 test cases covering all retry scenarios
- Ensure proper HTTP response body cleanup on retries to prevent resource leaks

* refactor: simplify retry logic and error handling in serverless invocation

* fix: max time

* fix: test
2026-01-20 16:46:39 +08:00
..