From c25dee7c8a7053743266c95b6a63a1b11ef3c1fb Mon Sep 17 00:00:00 2001 From: keepstep <58132194+keepstep@users.noreply.github.com> Date: Sat, 8 Oct 2022 21:19:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(registry/cache):=20do=20not=20watch=20when?= =?UTF-8?q?=20ttl=3D0=20eg:=20some=20custom=20registry=20no=20s=E2=80=A6?= =?UTF-8?q?=20(#2580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: keep --- registry/cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/cache/cache.go b/registry/cache/cache.go index 1bdf85d9..6f4d7141 100644 --- a/registry/cache/cache.go +++ b/registry/cache/cache.go @@ -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