fix: ensure ChannelIsMultiKey context key is set to false for single key retries
This commit is contained in:
@@ -269,6 +269,9 @@ func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, mode
|
|||||||
if channel.ChannelInfo.IsMultiKey {
|
if channel.ChannelInfo.IsMultiKey {
|
||||||
common.SetContextKey(c, constant.ContextKeyChannelIsMultiKey, true)
|
common.SetContextKey(c, constant.ContextKeyChannelIsMultiKey, true)
|
||||||
common.SetContextKey(c, constant.ContextKeyChannelMultiKeyIndex, index)
|
common.SetContextKey(c, constant.ContextKeyChannelMultiKeyIndex, index)
|
||||||
|
} else {
|
||||||
|
// 必须设置为 false,否则在重试到单个 key 的时候会导致日志显示错误
|
||||||
|
common.SetContextKey(c, constant.ContextKeyChannelIsMultiKey, false)
|
||||||
}
|
}
|
||||||
// c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", key))
|
// c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", key))
|
||||||
common.SetContextKey(c, constant.ContextKeyChannelKey, key)
|
common.SetContextKey(c, constant.ContextKeyChannelKey, key)
|
||||||
|
|||||||
Reference in New Issue
Block a user