mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat: add client availability tracking and error handling improvements
- Introduced `IsAvailable` and `SetUnavailable` methods to clients for availability tracking. - Integrated availability checks in client selection logic to skip unavailable clients. - Enhanced error handling by marking clients unavailable on specific error codes (e.g., 401, 402). - Removed redundant quota verification logs in client reordering logic.
This commit is contained in:
@@ -52,5 +52,12 @@ type Client interface {
|
||||
// Provider returns the name of the AI service provider (e.g., "gemini", "claude").
|
||||
Provider() string
|
||||
|
||||
// RefreshTokens refreshes the access tokens if needed
|
||||
RefreshTokens(ctx context.Context) error
|
||||
|
||||
// IsAvailable returns true if the client is available for use.
|
||||
IsAvailable() bool
|
||||
|
||||
// SetUnavailable sets the client to unavailable.
|
||||
SetUnavailable()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user