🐛 fix a bug.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
李寻欢 2021-08-31 11:50:33 +08:00
parent 083140fef8
commit 4c56d907ed

View File

@ -22,7 +22,7 @@ func initNacos() {
} }
cc := constant.ClientConfig{ cc := constant.ClientConfig{
AppName: "api1", AppName: "api1",
NamespaceId: "", //namespace id NamespaceId: "public", //namespace id
TimeoutMs: 5000, TimeoutMs: 5000,
NotLoadCacheAtStart: true, NotLoadCacheAtStart: true,
RotateTime: "1h", RotateTime: "1h",
@ -43,11 +43,12 @@ func initNacos() {
portNum, _ := strconv.Atoi(port) portNum, _ := strconv.Atoi(port)
pp := uint64(portNum) pp := uint64(portNum)
success, err := client.RegisterInstance(vo.RegisterInstanceParam{ success, err := client.RegisterInstance(vo.RegisterInstanceParam{
//Ip: "172.30.0.90", Ip: "api-demo",
Port: pp, Port: pp,
Weight: 10, Weight: 10,
Enable: true, Enable: true,
ServiceName: "api1", ServiceName: "api1",
Ephemeral: true,
}) })
log.Println("Nacos注册结果: ", success) log.Println("Nacos注册结果: ", success)
if err != nil { if err != nil {