mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Refactor API handlers to implement retry mechanism with configurable limits and improved error handling
- 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:
@@ -115,6 +115,15 @@ func (l *FileRequestLogger) IsEnabled() bool {
|
||||
return l.enabled
|
||||
}
|
||||
|
||||
// SetEnabled updates the request logging enabled state.
|
||||
// This method allows dynamic enabling/disabling of request logging.
|
||||
//
|
||||
// Parameters:
|
||||
// - enabled: Whether request logging should be enabled
|
||||
func (l *FileRequestLogger) SetEnabled(enabled bool) {
|
||||
l.enabled = enabled
|
||||
}
|
||||
|
||||
// LogRequest logs a complete non-streaming request/response cycle to a file.
|
||||
//
|
||||
// Parameters:
|
||||
|
||||
Reference in New Issue
Block a user