Comments (1)
我暂时的解决方法:
func (hr *HostReactor) GetServiceInfo(serviceName string, clusters string) model.Service {
key := utils.GetServiceCacheKey(serviceName, clusters)
cacheService, ok := hr.serviceInfoMap.Get(key)
if !ok {
hr.updateServiceNow(serviceName, clusters)
cacheService,ok = hr.serviceInfoMap.Get(key)
}
return cacheService.(model.Service)
}
这个方法解决了并发报错问题,但是还没有经过其他的回归测试。
from nacos-sdk-go.
Related Issues (20)
- [BUG] SubscribeServiceRequest 请求参数 clusters 失效 HOT 1
- v2.2.4版本初始话init时,存在很多无效的logger.Info()很影响应用程序输出,且无法通过参数控制取消,倒逼修改源码去掉了。望官方修复! HOT 17
- what mean: clients/naming_client/naming_client.go selectOneHealthyInstances line HOT 2
- cache not working
- 重启nacos服务端后编辑配置,客户端ListenConfig收不到消息 HOT 2
- constant.ClientConfig.updateCacheWhenEmpty配置项不起作用
- [version compatibility] success field of nacos server's response is empty HOT 2
- 运行出错 panic: runtime error: invalid memory address or nil pointer dereference HOT 5
- 当我注销一个实例后再次查询服务是查询的缓存然后再查询的实例,应该如何避免这个问题? HOT 2
- Ephemeral=true时,服务注册失败 HOT 2
- [BUG] Config listener doesn't execute when querying result is config doesn't exist
- 启动项目出现log日志 HOT 1
- Is there a way to manage Nacos Service via sdk? HOT 8
- 我在使用nacos作为配置中心的时候 为什么有时候能读取到配置 有时候读取的是空串 错误是nil HOT 2
- [BUG] naming proxy uses config metrics to record metrics. HOT 1
- 初始化nacos失败 问题 HOT 1
- ⚠️服务注册失败没有任何提示 HOT 1
- 不能连接nacos客户端 HOT 4
- Nacos 的 naming http client 的 PushReceiver 是否应该对 ReadFromUDP 方法增加 ctx 超时 HOT 2
- The local cache file create error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nacos-sdk-go.