hertz-contrib / registry

The service registration & discovery extensions for Hertz
Apache License 2.0
27 stars 39 forks source link

fix: get error resolver when user uses different nacos in few seconds #108

Open Skyenought opened 8 months ago

Skyenought commented 8 months ago

What type of PR is this?

fix

What this PR does / why we need it (English/Chinese):

在之前的 Name() 实现中return 的是一个常量, 在使用不同配置的 nacos 的默认情况下 uniqueKey := cacheKey(config.Resolver.Name(), config.Balancer.Name(), config.LbOpts) 会在短时间取到相同的结果

于是现在添加 timestamp 作为唯一标识, 防止出现取到错误数据

Which issue(s) this PR fixes:

https://github.com/hertz-contrib/registry/issues/107