mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
fix bug for local_cache
This commit is contained in:
parent
641a5f5e35
commit
1fbaddf559
@ -78,12 +78,15 @@ LRUFileCache::LRUFileCache(const String & cache_base_path_, const FileCacheSetti
|
||||
|
||||
void LRUFileCache::initialize()
|
||||
{
|
||||
if (fs::exists(cache_base_path))
|
||||
loadCacheInfoIntoMemory();
|
||||
else
|
||||
fs::create_directories(cache_base_path);
|
||||
|
||||
is_initialized = true;
|
||||
std::lock_guard cache_lock(mutex);
|
||||
if (!is_initialized)
|
||||
{
|
||||
if (fs::exists(cache_base_path))
|
||||
loadCacheInfoIntoMemory();
|
||||
else
|
||||
fs::create_directories(cache_base_path);
|
||||
is_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LRUFileCache::useCell(
|
||||
@ -624,8 +627,6 @@ void LRUFileCache::remove(
|
||||
|
||||
void LRUFileCache::loadCacheInfoIntoMemory()
|
||||
{
|
||||
std::lock_guard cache_lock(mutex);
|
||||
|
||||
Key key;
|
||||
UInt64 offset = 0;
|
||||
size_t size = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user