提交 224fae75 编写于 作者: G groot 提交者: jinhai

fix id miss bug


Former-commit-id: 53581de275e862ca9574014a6bd025918077dc59
上级 9941416b
......@@ -488,10 +488,14 @@ ServerError AddBatchVectorTask::OnExecute() {
std::list<std::future<void>> threads_list;
uint64_t begin_index = 0, end_index = USE_MT;
while(end_index < vec_count) {
while(true) {
threads_list.push_back(
GetThreadPool().enqueue(&AddBatchVectorTask::ProcessIdMapping,
this, vector_ids, begin_index, end_index, tensor_ids_));
if(end_index >= vec_count) {
break;
}
begin_index = end_index;
end_index += USE_MT;
if(end_index > vec_count) {
......
......@@ -211,7 +211,10 @@ TEST(AddVector, CLIENT_TEST) {
server::TimeRecorder rc("Add " + std::to_string(count) + " binary vectors in one batch");
std::vector<std::string> ids;
session.interface()->add_binary_vector_batch(ids, group.id, bin_tensor_list_2);
ASSERT_TRUE(!ids.empty());
ASSERT_EQ(ids.size(), bin_tensor_list_2.tensor_list.size());
for(size_t i = 0; i < ids.size(); i++) {
ASSERT_TRUE(!ids[i].empty());
}
rc.Elapse("done!");
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册