Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Chitti-Ankith committed Apr 11, 2024
1 parent d550f1d commit d11ee20
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/pinecone/pinecone_build.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ IndexBuildResult *pinecone_build(Relation heap, Relation index, IndexInfo *index
cJSON* index_stats_response;
InsertBaseTable(heap, index, indexInfo, host, result);

if (!pinecone_use_mock_response) {
// wait for the remote index to finish processing the vectors
// i.e. describe stats is equal to result->index_tuples
index_stats_response = pinecone_get_index_stats(pinecone_api_key, host);
while (cJSON_GetObjectItemCaseSensitive(index_stats_response, "totalVectorCount")->valueint < result->index_tuples) {
sleep(1);
#ifdef PINECONE_MOCK {
if (!pinecone_use_mock_response) {
#endif
// wait for the remote index to finish processing the vectors
// i.e. describe stats is equal to result->index_tuples
index_stats_response = pinecone_get_index_stats(pinecone_api_key, host);
while (cJSON_GetObjectItemCaseSensitive(index_stats_response, "totalVectorCount")->valueint < result->index_tuples) {
sleep(1);
index_stats_response = pinecone_get_index_stats(pinecone_api_key, host);
}
#ifdef PINECONE_MOCK
}
}
#endif
}
return result;
}
Expand Down

0 comments on commit d11ee20

Please sign in to comment.