fix: 修复保存限流组与错误分类规则后缓存失效函数无限递归导致 API 栈溢出崩溃
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m46s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m46s
invalidateGroups、invalidateRules 误写为调用自身,任何限流组或错误分类规则保存成功后 API 进程栈溢出退出;改为调用限流组与分类器的 Invalidate
This commit is contained in:
@@ -645,14 +645,14 @@ func uintString(value uint) string {
|
|||||||
|
|
||||||
// invalidateGroups 让本进程限流组缓存立即失效;其他进程在缓存时长(数秒)内自动刷新。
|
// invalidateGroups 让本进程限流组缓存立即失效;其他进程在缓存时长(数秒)内自动刷新。
|
||||||
func (s *GatewayRateLimitService) invalidateGroups() {
|
func (s *GatewayRateLimitService) invalidateGroups() {
|
||||||
if s.runtime != nil {
|
if s.runtime != nil && s.runtime.Groups != nil {
|
||||||
s.invalidateGroups()
|
s.runtime.Groups.Invalidate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// invalidateRules 让本进程错误分类规则缓存立即失效。
|
// invalidateRules 让本进程错误分类规则缓存立即失效。
|
||||||
func (s *GatewayRateLimitService) invalidateRules() {
|
func (s *GatewayRateLimitService) invalidateRules() {
|
||||||
if s.runtime != nil {
|
if s.runtime != nil && s.runtime.Classifier != nil {
|
||||||
s.invalidateRules()
|
s.runtime.Classifier.Invalidate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user