diff --git a/cpp/src/cache/Cache.inl b/cpp/src/cache/Cache.inl index be01c11c77e9f8ac7d445663539eb2e57e92f877..5ca1028318cfbdb16b73bae88f82f878f140d695 100644 --- a/cpp/src/cache/Cache.inl +++ b/cpp/src/cache/Cache.inl @@ -56,11 +56,11 @@ void Cache::insert(const std::string& key, const ItemObj& item) { return; } - if(item->size() > capacity_) { - SERVER_LOG_ERROR << "Item size " << item->size() - << " is too large to insert into cache, capacity " << capacity_; - return; - } +// if(item->size() > capacity_) { +// SERVER_LOG_ERROR << "Item size " << item->size() +// << " is too large to insert into cache, capacity " << capacity_; +// return; +// } //calculate usage { diff --git a/cpp/unittest/server/cache_test.cpp b/cpp/unittest/server/cache_test.cpp index 8599098b5511dde3d002f2d478a716c25fc72407..8293805209199c783f65c65f9c525b253fd1edca 100644 --- a/cpp/unittest/server/cache_test.cpp +++ b/cpp/unittest/server/cache_test.cpp @@ -162,7 +162,7 @@ TEST(CacheTest, CPU_CACHE_TEST) { engine::VecIndexPtr mock_index = std::make_shared(256, 6000000); cache::DataObjPtr data_obj = std::make_shared(mock_index); cpu_mgr->InsertItem("index_6g", data_obj); - ASSERT_FALSE(cpu_mgr->ItemExists("index_6g"));//data greater than capacity can not be inserted sucessfully + ASSERT_TRUE(cpu_mgr->ItemExists("index_6g")); } cpu_mgr->PrintInfo();