Skip to content

Commit

Permalink
fix async bug (zilliztech#889)
Browse files Browse the repository at this point in the history
Signed-off-by: yusheng.ma <[email protected]>
  • Loading branch information
Presburger authored and cqy123456 committed Jan 24, 2025
1 parent d19f936 commit d03109c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ inline const std::shared_ptr<Interrupt>
Index<T>::BuildAsync(const DataSetPtr dataset, const Json& json, const std::chrono::seconds timeout) {
auto pool = ThreadPool::GetGlobalBuildThreadPool();
auto interrupt = std::make_shared<Interrupt>(timeout);
interrupt->Set(pool->push([this, dataset, &json, &interrupt]() {
interrupt->Set(pool->push([this, dataset, json, interrupt]() {
auto cfg = this->node->CreateConfig();
RETURN_IF_ERROR(LoadConfig(cfg.get(), json, knowhere::TRAIN, "Build"));

Expand All @@ -65,7 +65,7 @@ inline const std::shared_ptr<Interrupt>
Index<T>::BuildAsync(const DataSetPtr dataset, const Json& json) {
auto pool = ThreadPool::GetGlobalBuildThreadPool();
auto interrupt = std::make_shared<Interrupt>();
interrupt->Set(pool->push([this, &dataset, &json]() { return this->Build(dataset, json); }));
interrupt->Set(pool->push([this, dataset, json]() { return this->Build(dataset, json); }));
return interrupt;
}
#endif
Expand Down

0 comments on commit d03109c

Please sign in to comment.