1010#include " pstd/include/scope_record_lock.h"
1111
1212extern PikaServer* g_pika_server;
13+ extern std::unique_ptr<PikaConf> g_pika_conf;
1314
1415PikaCacheLoadThread::PikaCacheLoadThread (int zset_cache_start_direction, int zset_cache_field_num_per_key)
1516 : should_exit_(false )
@@ -70,7 +71,7 @@ bool PikaCacheLoadThread::LoadHash(std::string& key, const std::shared_ptr<DB>&
7071 db->storage ()->HLen (key, &len);
7172 // If the Hash type contains more than 2048 data members,
7273 // it will not be updated to RedisCache
73- if (0 >= len || CACHE_VALUE_ITEM_MAX_SIZE < len) {
74+ if (0 >= len || g_pika_conf-> value_item_max_size_in_cache () < len) {
7475 return false ;
7576 }
7677
@@ -90,9 +91,9 @@ bool PikaCacheLoadThread::LoadList(std::string& key, const std::shared_ptr<DB>&
9091 db->storage ()->LLen (key, &len);
9192 // If the List type contains more than 2048 data members,
9293 // it will not be updated to RedisCache
93- if (len <= 0 || CACHE_VALUE_ITEM_MAX_SIZE < len) {
94+ if (len <= 0 || g_pika_conf-> value_item_max_size_in_cache () < len) {
9495 LOG (WARNING) << " can not load key, because item size:" << len
95- << " beyond max item size:" << CACHE_VALUE_ITEM_MAX_SIZE ;
96+ << " beyond max item size:" << g_pika_conf-> value_item_max_size_in_cache () ;
9697 return false ;
9798 }
9899
@@ -112,9 +113,9 @@ bool PikaCacheLoadThread::LoadSet(std::string& key, const std::shared_ptr<DB>& d
112113 db->storage ()->SCard (key, &len);
113114 // If the Set type contains more than 2048 data members,
114115 // it will not be updated to RedisCache
115- if (0 >= len || CACHE_VALUE_ITEM_MAX_SIZE < len) {
116+ if (0 >= len || g_pika_conf-> value_item_max_size_in_cache () < len) {
116117 LOG (WARNING) << " can not load key, because item size:" << len
117- << " beyond max item size:" << CACHE_VALUE_ITEM_MAX_SIZE ;
118+ << " beyond max item size:" << g_pika_conf-> value_item_max_size_in_cache () ;
118119 return false ;
119120 }
120121
0 commit comments