From 954285e4268a4c87696625eb3b5bfd5d401303fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 6 Sep 2022 15:19:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(cache):=E6=B8=85=E9=99=A4=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E7=9A=84=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cache/count.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cache/count.go b/cache/count.go index b0958bc..b1baa54 100644 --- a/cache/count.go +++ b/cache/count.go @@ -2,7 +2,6 @@ package cache import ( "fmt" - "log" "strings" "time" ) @@ -31,7 +30,6 @@ func CacheCount(relationNames []string, entityName string, count int64, conditio for _, relationName := range relationNames { CacheRelation(relationName, STORE_TYPE_KEY, countKey) } - log.Printf("[debug] [cache|save] count key: [%s], err: %+v", countKey, err) return err } @@ -46,11 +44,10 @@ func RetreiveCount(entityName string, condtions ...string) (int64, error) { return -1, nil } instance, err := Retreive[_CountRecord](countKey) - log.Printf("[debug] [cache|retreive] count key: [%s], instance: [%v], err: %+v", countKey, instance, err) - if instance != nil { + if instance != nil && err == nil { return instance.Count, nil } else { - return -1, nil + return -1, err } }