mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-04 21:40:51 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09b9d3b3fa | ||
|
|
e9e0016a63 |
@@ -17,6 +17,7 @@ import (
|
||||
. "github.com/luispater/CLIProxyAPI/internal/constant"
|
||||
"github.com/luispater/CLIProxyAPI/internal/interfaces"
|
||||
"github.com/luispater/CLIProxyAPI/internal/registry"
|
||||
"github.com/luispater/CLIProxyAPI/internal/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
@@ -193,7 +194,7 @@ outLoop:
|
||||
continue outLoop // Restart the client selection process
|
||||
}
|
||||
case 403, 408, 500, 502, 503, 504:
|
||||
log.Debugf("http status code %d, switch client", errInfo.StatusCode)
|
||||
log.Debugf("http status code %d, switch client, %s", errInfo.StatusCode, util.HideAPIKey(cliClient.GetEmail()))
|
||||
retryCount++
|
||||
continue outLoop
|
||||
default:
|
||||
|
||||
@@ -109,6 +109,7 @@ func (h *BaseAPIHandler) GetClient(modelName string, isGenerateContent ...bool)
|
||||
}
|
||||
|
||||
if len(clients) == 0 {
|
||||
h.Mutex.Unlock()
|
||||
return nil, &interfaces.ErrorMessage{StatusCode: 500, Error: fmt.Errorf("no clients available")}
|
||||
}
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ func (c *ClaudeClient) GetEmail() string {
|
||||
if ts, ok := c.tokenStorage.(*claude.ClaudeTokenStorage); ok {
|
||||
return ts.Email
|
||||
} else {
|
||||
return ""
|
||||
return c.cfg.ClaudeKey[c.apiKeyIndex].APIKey
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user