Skip to content

Commit dcdfe21

Browse files
committed
waiting on full index before return qdrant
1 parent d890fa1 commit dcdfe21

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

engine/clients/qdrant/upload.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,20 @@ def wait_collection_green(cls):
4545
while True:
4646
time.sleep(wait_time)
4747
total += wait_time
48+
4849
collection_info = cls.client.get_collection(QDRANT_COLLECTION_NAME)
4950
if collection_info.status != CollectionStatus.GREEN:
5051
continue
5152
time.sleep(wait_time)
5253
collection_info = cls.client.get_collection(QDRANT_COLLECTION_NAME)
5354
if collection_info.status == CollectionStatus.GREEN:
54-
break
55+
vectors_count = collection_info.vectors_count
56+
indexed_vectors_count = collection_info.indexed_vectors_count
57+
if vectors_count > indexed_vectors_count:
58+
print(f"waiting on fully indexed collection. vectors_count {vectors_count} != indexed_vectors_count {indexed_vectors_count}")
59+
continue
60+
else:
61+
break
5562
return total
5663

5764
@classmethod

0 commit comments

Comments
 (0)