Skip to content

Commit

Permalink
update: fix hit count for query when hit notFound cache
Browse files Browse the repository at this point in the history
  • Loading branch information
asjdf committed Feb 24, 2023
1 parent 0b77a67 commit 8f13c82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cache/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "|")
Expand Down

0 comments on commit 8f13c82

Please sign in to comment.