'commit'
This commit is contained in:
@@ -377,17 +377,22 @@ class VikingDBMemoryService(Service):
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < timeout:
|
||||
try:
|
||||
# 使用类中定义的集合名称常量
|
||||
collection_info = self.get_collection(MEMORY_COLLECTION_NAME)
|
||||
status = collection_info.get("Status", "UNKNOWN")
|
||||
# 打印完整集合信息用于调试
|
||||
logger.info(f"集合详细信息: {json.dumps(collection_info, ensure_ascii=False)}")
|
||||
|
||||
# 尝试多种可能的状态字段名
|
||||
status = collection_info.get("Status") or collection_info.get("status") or "UNKNOWN"
|
||||
logger.info(f"集合 '{MEMORY_COLLECTION_NAME}' 当前状态: {status}")
|
||||
if status == "READY":
|
||||
|
||||
# 检查是否为就绪状态(可能的值:READY, RUNNING, ACTIVE等)
|
||||
if status in ["READY", "RUNNING", "ACTIVE"]:
|
||||
return True
|
||||
time.sleep(interval)
|
||||
except Exception as e:
|
||||
logger.info(f"检查集合状态失败: {e}")
|
||||
logger.error(f"检查集合状态失败: {str(e)}")
|
||||
time.sleep(interval)
|
||||
logger.info(f"集合 '{MEMORY_COLLECTION_NAME}' 在{timeout}秒内未就绪")
|
||||
logger.error(f"集合 '{MEMORY_COLLECTION_NAME}' 在{timeout}秒内未就绪")
|
||||
return False
|
||||
|
||||
def setup_memory_collection(self):
|
||||
|
Reference in New Issue
Block a user