Pacific73 / gorm-cache

gorm v2的即插即用、无需修改代码的旁路缓存。An easy-to-use look-aside cache solution for gorm v2 users.
Apache License 2.0
111 stars 29 forks source link

关于CacheMaxItemCnt #27

Closed xcel3011 closed 1 year ago

xcel3011 commented 1 year ago
// CacheMaxItemCnt for given query, if objects retrieved are more than this cnt,
// then we choose not to cache for this query. 0 represents caching all queries.
CacheMaxItemCnt int64

注释里写着0表示缓存所有,但是判断的时候好像没特殊判断0。
// cache search data
if int64(len(objects)) > cache.Config.CacheMaxItemCnt {
    return
}
Pacific73 commented 1 year ago

感谢建议,最新版本中已经修复。