mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 07:20:26 +00:00
feat: automatically disable channel when error occurred (#59)
This commit is contained in:
@@ -62,6 +62,8 @@ func Distribute() func(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
c.Set("channel", channel.Type)
|
||||
c.Set("channel_id", channel.Id)
|
||||
c.Set("channel_name", channel.Name)
|
||||
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
|
||||
if channel.Type == common.ChannelTypeCustom || channel.Type == common.ChannelTypeAzure {
|
||||
c.Set("base_url", channel.BaseURL)
|
||||
|
Reference in New Issue
Block a user