mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-30 22:33:49 +02:00
fix(registry/cache): do not watch when ttl=0 eg: some custom registry no s… (#2580)
Co-authored-by: keep <keep@pa.com>
This commit is contained in:
2
registry/cache/cache.go
vendored
2
registry/cache/cache.go
vendored
@ -174,7 +174,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) {
|
||||
c.RUnlock()
|
||||
|
||||
// check if its being watched
|
||||
if !ok {
|
||||
if c.opts.TTL > 0 && !ok {
|
||||
c.Lock()
|
||||
|
||||
// set to watched
|
||||
|
Reference in New Issue
Block a user