Skip to content

Commit

Permalink
fix async bug (#889)
Browse files Browse the repository at this point in the history
Signed-off-by: yusheng.ma <[email protected]>
  • Loading branch information
Presburger authored Oct 16, 2024
1 parent be5e77c commit 0a30859
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 0a30859

Please sign in to comment.