From 59544b03418cb55c1d28ea0db24900a3fd140d76 Mon Sep 17 00:00:00 2001 From: Xu Peng Date: Wed, 15 May 2019 11:47:21 +0800 Subject: [PATCH] fix(db): fix cache error after load file from disk Former-commit-id: 23dd81d168caa49451634ef7a97c6fa618c92957 --- cpp/src/db/FaissExecutionEngine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/src/db/FaissExecutionEngine.cpp b/cpp/src/db/FaissExecutionEngine.cpp index cc0f1046d6..9f70318a6b 100644 --- a/cpp/src/db/FaissExecutionEngine.cpp +++ b/cpp/src/db/FaissExecutionEngine.cpp @@ -64,13 +64,16 @@ Status FaissExecutionEngine::Serialize() { template Status FaissExecutionEngine::Load() { auto index = zilliz::vecwise::cache::CpuCacheMgr::GetInstance()->GetIndex(location_); + bool to_cache; if (!index) { index = read_index(location_); - Cache(); LOG(DEBUG) << "Disk io from: " << location_; } pIndex_ = index->data(); + if (to_cache) { + Cache(); + } return Status::OK(); }