diff --git a/internal/service/polling/gateway_rate_limit_service.go b/internal/service/polling/gateway_rate_limit_service.go index 40240da1..653dca68 100644 --- a/internal/service/polling/gateway_rate_limit_service.go +++ b/internal/service/polling/gateway_rate_limit_service.go @@ -645,14 +645,14 @@ func uintString(value uint) string { // invalidateGroups 让本进程限流组缓存立即失效;其他进程在缓存时长(数秒)内自动刷新。 func (s *GatewayRateLimitService) invalidateGroups() { - if s.runtime != nil { - s.invalidateGroups() + if s.runtime != nil && s.runtime.Groups != nil { + s.runtime.Groups.Invalidate() } } // invalidateRules 让本进程错误分类规则缓存立即失效。 func (s *GatewayRateLimitService) invalidateRules() { - if s.runtime != nil { - s.invalidateRules() + if s.runtime != nil && s.runtime.Classifier != nil { + s.runtime.Classifier.Invalidate() } }