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

This commit is contained in:
李寻欢 2021-08-31 13:47:38 +08:00
parent 4c56d907ed
commit 5c718886bd

View File

@ -22,7 +22,7 @@ func initNacos() {
} }
cc := constant.ClientConfig{ cc := constant.ClientConfig{
AppName: "api1", AppName: "api1",
NamespaceId: "public", //namespace id NamespaceId: "", //namespace id
TimeoutMs: 5000, TimeoutMs: 5000,
NotLoadCacheAtStart: true, NotLoadCacheAtStart: true,
RotateTime: "1h", RotateTime: "1h",
@ -47,6 +47,7 @@ func initNacos() {
Port: pp, Port: pp,
Weight: 10, Weight: 10,
Enable: true, Enable: true,
Healthy: true,
ServiceName: "api1", ServiceName: "api1",
Ephemeral: true, Ephemeral: true,
}) })
@ -63,7 +64,7 @@ func initNacos() {
DataId: "api.yml", DataId: "api.yml",
Group: "DEFAULT_GROUP", Group: "DEFAULT_GROUP",
OnChange: func(namespace, group, dataId, data string) { OnChange: func(namespace, group, dataId, data string) {
fmt.Println("group:" + group + ", dataId:" + dataId + ", data:" + data) fmt.Println("监控到配置文件变动: group:" + group + ", dataId:" + dataId + ", data:" + data)
}, },
}) })
//log.Println("监听配置失败: ", err.Error()) //log.Println("监听配置失败: ", err.Error())