From 8f13c829cc7d8c3fb52ea0f5a4c846de8226bceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E9=94=B4?= Date: Sat, 25 Feb 2023 01:28:50 +0800 Subject: [PATCH] update: fix hit count for query when hit notFound cache --- cache/query.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cache/query.go b/cache/query.go index 56eccf2..add7b10 100644 --- a/cache/query.go +++ b/cache/query.go @@ -167,6 +167,7 @@ func (h *queryHandler) BeforeQuery() func(db *gorm.DB) { cache.Logger.CtxInfo(ctx, "[BeforeQuery] get value: %s", cacheValue) if cacheValue == "recordNotFound" { // 应对缓存穿透 db.Error = util.RecordNotFoundCacheHit + hitted = true return } rowsAffectedPos := strings.Index(cacheValue, "|")