-
Notifications
You must be signed in to change notification settings - Fork 65
feat: support load nearby routes from cache files #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support load nearby routes from cache files #262
Conversation
pkg/flow/base_flow.go
Outdated
| } | ||
|
|
||
| // 如果至少有一个规则已初始化,则标记为已启用 | ||
| if routeRule.IsInitialized() || nearbyRouteRule.IsInitialized() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
规则路由和就近路由共用trigger.EnableDstRoute吗?
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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的序列化,可能会有性能损耗。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,我优化一下
SkyeBeFreeman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
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.
Please check any characteristics that apply to this pull request.