mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
[skip ci] Update codes of drop func on benchmark (#13056)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>
This commit is contained in:
parent
6845d2d90c
commit
bc2bd2d0fe
@ -418,20 +418,20 @@ class MilvusClient(object):
|
||||
logger.debug("Row count: %d in collection: <%s>" % (row_count, collection_name))
|
||||
return row_count
|
||||
|
||||
def drop(self, timeout=120, collection_name=None):
|
||||
def drop(self, loop_cunt=120, collection_name=None):
|
||||
"""
|
||||
drop steps:
|
||||
1.drop collection
|
||||
2.check collection exist
|
||||
3.Set timeout to exit
|
||||
"""
|
||||
timeout = int(timeout)
|
||||
loop_cunt = int(loop_cunt)
|
||||
if collection_name is None:
|
||||
collection_name = self._collection_name
|
||||
logger.info("Start delete collection: %s" % collection_name)
|
||||
self._milvus.drop_collection(collection_name)
|
||||
i = 0
|
||||
while i < timeout:
|
||||
while i < loop_cunt:
|
||||
try:
|
||||
res = self._milvus.has_collection(collection_name)
|
||||
if res:
|
||||
@ -443,7 +443,7 @@ class MilvusClient(object):
|
||||
except Exception as e:
|
||||
logger.warning("Collection count failed: {}".format(str(e)))
|
||||
break
|
||||
if i >= timeout:
|
||||
if i >= loop_cunt:
|
||||
logger.error("Delete collection timeout")
|
||||
|
||||
def get_stats(self):
|
||||
|
Loading…
Reference in New Issue
Block a user