Skip to content

Commit

Permalink
Merge pull request #14 from uestc-wxy/main
Browse files Browse the repository at this point in the history
修改熔断值
  • Loading branch information
palp1tate authored Sep 2, 2023
2 parents 12735a7 + 34beb92 commit 1d9da2e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/gateway/wrapper/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package wrapper
import "github.com/afex/hystrix-go/hystrix"

var CommentActionFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 10秒内的请求量,默认值是20,如果超过20那么就判断是否熔断
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var CommentListFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down
4 changes: 2 additions & 2 deletions app/gateway/wrapper/favorite.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package wrapper
import "github.com/afex/hystrix-go/hystrix"

var FavoriteActionFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 10秒内的请求量,默认值是20,如果超过20那么就判断是否熔断
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var FavoriteListFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down
4 changes: 2 additions & 2 deletions app/gateway/wrapper/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package wrapper
import "github.com/afex/hystrix-go/hystrix"

var ActionMessageFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 10秒内的请求量,默认值是20,如果超过20那么就判断是否熔断
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var ChatMessageFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down
6 changes: 3 additions & 3 deletions app/gateway/wrapper/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ var ActionRelationFuseConfig = hystrix.CommandConfig{
}

var ListFollowRelationFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var ListFollowerRelationFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var ListFriendRelationFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down
4 changes: 2 additions & 2 deletions app/gateway/wrapper/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package wrapper
import "github.com/afex/hystrix-go/hystrix"

var RegisterFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 10秒内的请求量,默认值是20,如果超过20那么就判断是否熔断
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
MaxConcurrentRequests: 10000,
}

var LoginFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down
2 changes: 1 addition & 1 deletion app/gateway/wrapper/video.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var PublishFuseConfig = hystrix.CommandConfig{
MaxConcurrentRequests: 10000,
}
var PublishListFuseConfig = hystrix.CommandConfig{
Timeout: 500,
Timeout: 1000,
RequestVolumeThreshold: 5000, // 熔断器请求阈值,默认20,意思是有20个请求才能进行错误百分比计算
ErrorPercentThreshold: 50, // 错误百分比,当错误超过百分比时,直接进行降级处理,直至熔断器再次 开启,默认50%
SleepWindow: 5000, // 过多长时间,熔断器再次检测是否开启,单位毫秒ms(默认5秒)
Expand Down

0 comments on commit 1d9da2e

Please sign in to comment.