mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-14 06:20:27 +00:00
feat: support cloudflare now
This commit is contained in:
@@ -57,6 +57,8 @@ func testChannel(channel *model.Channel) (err error, openaiErr *relaymodel.Error
|
||||
c.Request.Header.Set("Content-Type", "application/json")
|
||||
c.Set(ctxkey.Channel, channel.Type)
|
||||
c.Set(ctxkey.BaseURL, channel.GetBaseURL())
|
||||
cfg, _ := channel.LoadConfig()
|
||||
c.Set(ctxkey.Config, cfg)
|
||||
middleware.SetupContextForSelectedChannel(c, channel, "")
|
||||
meta := meta.GetByContext(c)
|
||||
apiType := channeltype.ToAPIType(channel.Type)
|
||||
|
@@ -57,7 +57,7 @@ func Relay(c *gin.Context) {
|
||||
group := c.GetString(ctxkey.Group)
|
||||
originalModel := c.GetString(ctxkey.OriginalModel)
|
||||
go processChannelRelayError(ctx, channelId, channelName, bizErr)
|
||||
requestId := c.GetString(logger.RequestIdKey)
|
||||
requestId := c.GetString(helper.RequestIdKey)
|
||||
retryTimes := config.RetryTimes
|
||||
if !shouldRetry(c, bizErr.StatusCode) {
|
||||
logger.Errorf(ctx, "relay error happen, status code is %d, won't retry in this case", bizErr.StatusCode)
|
||||
|
Reference in New Issue
Block a user