Skip to content

Conversation

@peerless1024
Copy link
Member

Please provide issue(s) of this PR:
feat: support load nearby routes from cache files

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Configuration
  • Docs
  • Performance and Scalability
  • Naming
  • HealthCheck
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

}

// 如果至少有一个规则已初始化,则标记为已启用
if routeRule.IsInitialized() || nearbyRouteRule.IsInitialized() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

规则路由和就近路由共用trigger.EnableDstRoute吗?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在拆开了,再看下

// invalidRegexes = false
for _, source := range sources {
for i, source := range sources {
log.GetBaseLogger().Debugf("[RuleBasedRouter] matchSource: checking source[%d], ns=%s, svc=%s, metadataCount=%d, metadata=%v",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议使用if log.GetBaseLogger().IsLevelEnabled(log.DebugLog)判断是否开启debug日志,因为所有的请求都处理source.Metadata的序列化,可能会有性能损耗。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,我优化一下

Copy link
Member

@SkyeBeFreeman SkyeBeFreeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@peerless1024 peerless1024 merged commit bbe71dc into polarismesh:main Dec 16, 2025
12 checks passed
@peerless1024 peerless1024 deleted the fix/loadNearbyRuleFromCache branch December 16, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants