Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jun 28, 2021
1 parent a555d4d commit ea769f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const (
EnvEtcdPassword = "XSERVICE_ETCD_PASSWORD"

// config key
ConfigServiceAddr = "http.address"
ConfigServiceAdviceAddr = "http.advice_address"
ConfigServiceAddr = "http.address"
ConfigServiceAdvertisedAddr = "http.advertised_address"

ServiceConfigKeyPrefix = "xservice/config"
ServiceRegisterKeyPrefix = "xservice/register"
Expand Down
4 changes: 2 additions & 2 deletions core/xservice/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func loadOptions(options ...Option) *Options {
}

if opts.Config.IsSet(core.ConfigServiceAddr) {
addviceAddr := opts.Config.GetString(core.ConfigServiceAdviceAddr)
addviceAddr := opts.Config.GetString(core.ConfigServiceAdvertisedAddr)
if addviceAddr == "" {
address := opts.Config.GetString(core.ConfigServiceAddr)
_, port, err := net.SplitHostPort(address)
Expand All @@ -121,7 +121,7 @@ func loadOptions(options ...Option) *Options {
}
addviceAddr = net.JoinHostPort(netx.InternalIp(), port)

opts.Config.SetDefault(core.ConfigServiceAdviceAddr, addviceAddr)
opts.Config.SetDefault(core.ConfigServiceAdvertisedAddr, addviceAddr)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/xservice/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (t *serverImpl) doRegisterGrpcServiceEtcd(ctx context.Context) {
if sl, ok := leaseMap[desc.ServiceName]; ok {
return sl
}
addr := t.options.Config.GetString(core.ConfigServiceAdviceAddr)
addr := t.options.Config.GetString(core.ConfigServiceAdvertisedAddr)
sl := &serviceLease{
id: 0,
lease: clientv3.NewLease(client),
Expand Down
4 changes: 2 additions & 2 deletions tools/xservice/gogen/assets/project/config-example.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http:
address: 0.0.0.0:5000
# advice address for service discover. eg load balancer, or server external network address
# advice_address: 192.168.8.20:5000
# advertised address for service discover. eg load balancer, or server external network address
# advertised_address: 192.168.8.20:5000

# jaeger configuration
# env configuration is ok, refer: https://www.jaegertracing.io/docs/1.23/client-features
Expand Down

0 comments on commit ea769f7

Please sign in to comment.