1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-30 10:10:44 +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:
keepstep 2022-10-08 21:19:48 +08:00 committed by GitHub
parent 24dfcef49a
commit c25dee7c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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