Refactor API handlers to implement retry mechanism with configurable limits and improved error handling
Some checks failed
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled

- Introduced retry counter with a configurable ` RequestRetry ` limit in all handlers.
- Enhanced error handling with specific HTTP status codes for switching clients.
- Standardized response forwarding for non-retriable errors.
- Improved logging for quota and client switch scenarios.
This commit is contained in:
Luis Pater
2025-08-25 23:27:30 +08:00
parent 8c555c4e69
commit 9102ff031d
11 changed files with 148 additions and 43 deletions

View File

@@ -4,6 +4,9 @@ auth-dir: "~/.cli-proxy-api"
debug: true
proxy-url: ""
# Request retry times, if the response http code is 403, 408, 500, 502, 503, 504, it will retry
request-retry: 3
# Quota exceeded behavior
quota-exceeded:
switch-project: true