File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ func (h *queryHandler) AfterQuery() func(db *gorm.DB) {
245
245
246
246
if cache .Config .CacheLevel == config .CacheLevelAll || cache .Config .CacheLevel == config .CacheLevelOnlySearch {
247
247
// cache search data
248
- if int64 (len (objects )) > cache .Config .CacheMaxItemCnt {
248
+ if cache . Config . CacheMaxItemCnt != 0 && int64 (len (objects )) > cache .Config .CacheMaxItemCnt {
249
249
return
250
250
}
251
251
@@ -273,7 +273,7 @@ func (h *queryHandler) AfterQuery() func(db *gorm.DB) {
273
273
if len (primaryKeys ) != len (objects ) {
274
274
return
275
275
}
276
- if int64 (len (objects )) > cache .Config .CacheMaxItemCnt {
276
+ if cache . Config . CacheMaxItemCnt != 0 && int64 (len (objects )) > cache .Config .CacheMaxItemCnt {
277
277
cache .Logger .CtxInfo (ctx , "[AfterQuery] objects length is more than max item count, not cached" )
278
278
return
279
279
}
You can’t perform that action at this time.
0 commit comments