Skip to content

Commit

Permalink
fix:服务列表支持服务可见性&修复服务可见性优先级判断
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Nov 29, 2024
1 parent 46387bf commit a09ba84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ func (s *Server) GetServiceWithCache(ctx context.Context, req *apiservice.Servic
for i := range visibleSvcs {
revisions = append(revisions, visibleSvcs[i].Revision)
}
svcs = append(svcs, visibleSvcs...)
// 需要重新计算 revison
if rever, err := cachetypes.CompositeComputeRevision(revisions); err != nil {
log.Error("[Server][Discover] list services compute multi revision",
zap.String("namespace", req.GetNamespace().GetValue()), zap.Error(err))
return api.NewDiscoverInstanceResponse(apimodel.Code_ExecuteException, req)
} else {

Check warning on line 192 in service/client_v1.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.21.5)

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
revision = rever
}
svcs = append(svcs, visibleSvcs...)
// 需要重新计算 revison
} else {
// 这里拉的是全部服务实例列表,如果客户端可以发起这个请求,应该是不需要
revision, svcs = s.Cache().Service().ListAllServices(ctx)
Expand Down

0 comments on commit a09ba84

Please sign in to comment.