From 47d52d250d2aa368f41862337e74cd81503d9f1a Mon Sep 17 00:00:00 2001 From: JinHai-CN Date: Sun, 3 Nov 2019 15:14:42 +0800 Subject: [PATCH] Fix typo bug Former-commit-id: 8b544b2158f89fea48a174e2f64128fa61706259 --- core/src/scheduler/job/BuildIndexJob.cpp | 5 ++++- core/src/scheduler/job/SearchJob.cpp | 5 ++++- core/src/wrapper/ConfAdapter.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/scheduler/job/BuildIndexJob.cpp b/core/src/scheduler/job/BuildIndexJob.cpp index 4c4c3b505..3247383db 100644 --- a/core/src/scheduler/job/BuildIndexJob.cpp +++ b/core/src/scheduler/job/BuildIndexJob.cpp @@ -50,7 +50,10 @@ void BuildIndexJob::BuildIndexDone(size_t to_index_id) { std::unique_lock lock(mutex_); to_index_files_.erase(to_index_id); - cv_.notify_all(); + if (to_index_files_.empty()) { + cv_.notify_all(); + } + SERVER_LOG_DEBUG << "BuildIndexJob " << id() << " finish index file: " << to_index_id; } diff --git a/core/src/scheduler/job/SearchJob.cpp b/core/src/scheduler/job/SearchJob.cpp index ee41c1ae0..ec93c69f5 100644 --- a/core/src/scheduler/job/SearchJob.cpp +++ b/core/src/scheduler/job/SearchJob.cpp @@ -49,7 +49,10 @@ void SearchJob::SearchDone(size_t index_id) { std::unique_lock lock(mutex_); index_files_.erase(index_id); - cv_.notify_all(); + if (index_files_.empty()) { + cv_.notify_all(); + } + SERVER_LOG_DEBUG << "SearchJob " << id() << " finish index file: " << index_id; } diff --git a/core/src/wrapper/ConfAdapter.cpp b/core/src/wrapper/ConfAdapter.cpp index 2dcf6bab7..a27bceecb 100644 --- a/core/src/wrapper/ConfAdapter.cpp +++ b/core/src/wrapper/ConfAdapter.cpp @@ -109,7 +109,7 @@ IVFSQConfAdapter::Match(const TempMetaConf& metaconf) { conf->nlist = MatchNlist(metaconf.size, metaconf.nlist); conf->d = metaconf.dim; conf->metric_type = metaconf.metric_type; - conf->gpu_id = conf->gpu_id; + conf->gpu_id = metaconf->gpu_id; conf->nbits = 8; MatchBase(conf); return conf; -- GitLab