Browse Source

🐛 fix a bug.

master
李寻欢 9 months ago
parent
commit
4c56d907ed
  1. 5
      main.go

5
main.go

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

Loading…
Cancel
Save