### What problem does this PR solve? Fix: the output log is incorrect ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: liang <xiaofeng.liang@landstech.com.cn>tags/v0.20.0
| if str(e).find("Timeout") > 0: | if str(e).find("Timeout") > 0: | ||||
| continue | continue | ||||
| raise e | raise e | ||||
| logger.error("ESConnection.search timeout for 3 times!") | |||||
| logger.error(f"ESConnection.search timeout for {ATTEMPT_TIME} times!") | |||||
| raise Exception("ESConnection.search timeout.") | raise Exception("ESConnection.search timeout.") | ||||
| def get(self, chunkId: str, indexName: str, knowledgebaseIds: list[str]) -> dict | None: | def get(self, chunkId: str, indexName: str, knowledgebaseIds: list[str]) -> dict | None: | ||||
| if str(e).find("Timeout") > 0: | if str(e).find("Timeout") > 0: | ||||
| continue | continue | ||||
| raise e | raise e | ||||
| logger.error("ESConnection.get timeout for 3 times!") | |||||
| logger.error(f"ESConnection.get timeout for {ATTEMPT_TIME} times!") | |||||
| raise Exception("ESConnection.get timeout.") | raise Exception("ESConnection.get timeout.") | ||||
| def insert(self, documents: list[dict], indexName: str, knowledgebaseId: str = None) -> list[str]: | def insert(self, documents: list[dict], indexName: str, knowledgebaseId: str = None) -> list[str]: | ||||
| except Exception: | except Exception: | ||||
| logger.exception("ESConnection.sql got exception") | logger.exception("ESConnection.sql got exception") | ||||
| return None | return None | ||||
| logger.error("ESConnection.sql timeout for 3 times!") | |||||
| logger.error(f"ESConnection.sql timeout for {ATTEMPT_TIME} times!") | |||||
| return None | return None |
| if str(e).find("Timeout") > 0: | if str(e).find("Timeout") > 0: | ||||
| continue | continue | ||||
| raise e | raise e | ||||
| logger.error("OSConnection.search timeout for 3 times!") | |||||
| logger.error(f"OSConnection.search timeout for {ATTEMPT_TIME} times!") | |||||
| raise Exception("OSConnection.search timeout.") | raise Exception("OSConnection.search timeout.") | ||||
| def get(self, chunkId: str, indexName: str, knowledgebaseIds: list[str]) -> dict | None: | def get(self, chunkId: str, indexName: str, knowledgebaseIds: list[str]) -> dict | None: | ||||
| if str(e).find("Timeout") > 0: | if str(e).find("Timeout") > 0: | ||||
| continue | continue | ||||
| raise e | raise e | ||||
| logger.error("OSConnection.get timeout for 3 times!") | |||||
| logger.error(f"OSConnection.get timeout for {ATTEMPT_TIME} times!") | |||||
| raise Exception("OSConnection.get timeout.") | raise Exception("OSConnection.get timeout.") | ||||
| def insert(self, documents: list[dict], indexName: str, knowledgebaseId: str = None) -> list[str]: | def insert(self, documents: list[dict], indexName: str, knowledgebaseId: str = None) -> list[str]: | ||||
| except Exception: | except Exception: | ||||
| logger.exception("OSConnection.sql got exception") | logger.exception("OSConnection.sql got exception") | ||||
| return None | return None | ||||
| logger.error("OSConnection.sql timeout for 3 times!") | |||||
| logger.error(f"OSConnection.sql timeout for {ATTEMPT_TIME} times!") | |||||
| return None | return None |