Skip to content

Commit 8f13c82

Browse files
committed
update: fix hit count for query when hit notFound cache
1 parent 0b77a67 commit 8f13c82

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cache/query.go

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func (h *queryHandler) BeforeQuery() func(db *gorm.DB) {
167167
cache.Logger.CtxInfo(ctx, "[BeforeQuery] get value: %s", cacheValue)
168168
if cacheValue == "recordNotFound" { // 应对缓存穿透
169169
db.Error = util.RecordNotFoundCacheHit
170+
hitted = true
170171
return
171172
}
172173
rowsAffectedPos := strings.Index(cacheValue, "|")

0 commit comments

Comments
 (0)