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 )
@@ -71,7 +72,7 @@ bool PikaCacheLoadThread::LoadHash(std::string& key, const std::shared_ptr<DB>&
7172 db->storage ()->HLen (key, &len);
7273 // If the Hash type contains more than 2048 data members,
7374 // it will not be updated to RedisCache
74- if (0 >= len || CACHE_VALUE_ITEM_MAX_SIZE < len) {
75+ if (0 >= len || g_pika_conf-> value_item_max_size_in_cache () < len) {
7576 return false ;
7677 }
7778
@@ -92,9 +93,9 @@ bool PikaCacheLoadThread::LoadList(std::string& key, const std::shared_ptr<DB>&
9293 db->storage ()->LLen (key, &len);
9394 // If the List type contains more than 2048 data members,
9495 // it will not be updated to RedisCache
95- if (len <= 0 || CACHE_VALUE_ITEM_MAX_SIZE < len) {
96+ if (len <= 0 || g_pika_conf-> value_item_max_size_in_cache () < len) {
9697 LOG (WARNING) << " can not load key, because item size:" << len
97- << " beyond max item size:" << CACHE_VALUE_ITEM_MAX_SIZE ;
98+ << " beyond max item size:" << g_pika_conf-> value_item_max_size_in_cache () ;
9899 return false ;
99100 }
100101
@@ -115,9 +116,9 @@ bool PikaCacheLoadThread::LoadSet(std::string& key, const std::shared_ptr<DB>& d
115116 db->storage ()->SCard (key, &len);
116117 // If the Set type contains more than 2048 data members,
117118 // it will not be updated to RedisCache
118- if (0 >= len || CACHE_VALUE_ITEM_MAX_SIZE < len) {
119+ if (0 >= len || g_pika_conf-> value_item_max_size_in_cache () < len) {
119120 LOG (WARNING) << " can not load key, because item size:" << len
120- << " beyond max item size:" << CACHE_VALUE_ITEM_MAX_SIZE ;
121+ << " beyond max item size:" << g_pika_conf-> value_item_max_size_in_cache () ;
121122 return false ;
122123 }
123124
0 commit comments