mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Bump infinity to v0.5.0-dev5 (#3520)
### What problem does this PR solve? Bump infinity to v0.5.0-dev5 ### Type of change - [x] Refactoring
This commit is contained in:
@ -7,6 +7,7 @@ import infinity
|
||||
from infinity.common import ConflictType, InfinityException, SortType
|
||||
from infinity.index import IndexInfo, IndexType
|
||||
from infinity.connection_pool import ConnectionPool
|
||||
from infinity.errors import ErrorCode
|
||||
from rag import settings
|
||||
from rag.utils import singleton
|
||||
import polars as pl
|
||||
@ -61,10 +62,13 @@ class InfinityConnection(DocStoreConnection):
|
||||
try:
|
||||
connPool = ConnectionPool(infinity_uri)
|
||||
inf_conn = connPool.get_conn()
|
||||
_ = inf_conn.show_current_node()
|
||||
res = inf_conn.show_current_node()
|
||||
connPool.release_conn(inf_conn)
|
||||
self.connPool = connPool
|
||||
break
|
||||
if res.error_code == ErrorCode.OK and res.server_status=="started":
|
||||
break
|
||||
logging.warn(f"Infinity status: {res.server_status}. Waiting Infinity {infinity_uri} to be healthy.")
|
||||
time.sleep(5)
|
||||
except Exception as e:
|
||||
logging.warning(f"{str(e)}. Waiting Infinity {infinity_uri} to be healthy.")
|
||||
time.sleep(5)
|
||||
@ -89,10 +93,9 @@ class InfinityConnection(DocStoreConnection):
|
||||
inf_conn = self.connPool.get_conn()
|
||||
res = inf_conn.show_current_node()
|
||||
self.connPool.release_conn(inf_conn)
|
||||
color = "green" if res.error_code == 0 else "red"
|
||||
res2 = {
|
||||
"type": "infinity",
|
||||
"status": f"{res.role} {color}",
|
||||
"status": "green" if res.error_code == 0 and res.server_status == "started" else "red",
|
||||
"error": res.error_msg,
|
||||
}
|
||||
return res2
|
||||
|
||||
Reference in New Issue
Block a user