We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c, err := agollo.New("http://127.0.0.1:8080", "test", agollo.AutoFetchOnCacheMiss(), // agollo.FailTolerantOnBackupExists(), // 关闭容灾 ) failOnError(err, "初始化失败") defer c.Stop() _ = c.Start() func() { for { time.Sleep(1e9) fmt.Println("a:", c.Get("a"), "b:", c.Get("b")) } }()
结果如下: a: 1 b: 2 a: b: a: b: a: b: a: b: a: b: ...
The text was updated successfully, but these errors were encountered:
我调试了你的代码, 我认为问题出在 agollo.go 文件的166行, 收到的status为304, 所以你将空结果覆盖了正常的结果. 当然如果开启了容灾(174行), 这个程序不会出问题.
上测: 在 reloadNamespace() 方法中将旧的 NotificationID 传入, 方法内检查旧的 NotificationID 为-1时使用不同策略 中策: 可以考虑在(477行)加入判断, 当旧的 NotificationID 为-1时, 不需要加载新的值 下策: 我还是开启 agollo.FailTolerantOnBackupExists() 吧
reloadNamespace()
NotificationID
agollo.FailTolerantOnBackupExists()
Sorry, something went wrong.
非常感谢你的反馈,我修复一下这个问题。
@zlyuancn 我已在最新的release版本中修复该问题release 再次感谢你的支持和反馈.
No branches or pull requests
结果如下:
a: 1 b: 2
a: b:
a: b:
a: b:
a: b:
a: b:
...
The text was updated successfully, but these errors were encountered: