RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
RAGFlow CLI: ping server before input password when login user (#12791)
Jin Haie1df82946e42
diff --git a/admin/client/http_client.py b/admin/client/http_client.pyindex ec94a1df0d..c0e2086c9b 100644--- a/admin/client/http_client.py+++ b/admin/client/http_client.py@@ -87,7 +87,7 @@ class HttpClient:url = self.build_url(path, use_api_base=use_api_base)merged_headers = self._headers(auth_kind, headers)# timeout: Tuple[float, float] = (self.connect_timeout, self.read_timeout)- session = requests.Session()+ # session = requests.Session()# adapter = HTTPAdapter(pool_connections=100, pool_maxsize=100)# session.mount("http://", adapter)if iterations > 1:@@ -95,37 +95,35 @@ class HttpClient:total_duration = 0.0for _ in range(iterations):start_time = time.perf_counter()- response = session.get(url, headers=merged_headers, json=json_body, data=data, stream=stream)- # response = requests.request(- # method=method,- # url=url,- # headers=merged_headers,- # json=json_body,- # data=data,- # files=files,- # params=params,- # timeout=timeout,- # stream=stream,- # verify=self.verify_ssl,- # )+ # response = session.get(url, headers=merged_headers, json=json_body, data=data, stream=stream)+ response = requests.request(+ method=method,+ url=url,+ headers=merged_headers,+ json=json_body,+ data=data,+ files=files,+ params=params,+ stream=stream,+ verify=self.verify_ssl,+ )end_time = time.perf_counter()total_duration += end_time - start_timeresponse_list.append(response)return {"duration": total_duration, "response_list": response_list}else:- return session.get(url, headers=merged_headers, json=json_body, data=data, stream=stream)- # return requests.request(- # method=method,- # url=url,- # headers=merged_headers,- # json=json_body,- # data=data,- # files=files,- # params=params,- # timeout=timeout,- # stream=stream,- # verify=self.verify_ssl,- # )+ # return session.get(url, headers=merged_headers, json=json_body, data=data, stream=stream)+ return requests.request(+ method=method,+ url=url,+ headers=merged_headers,+ json=json_body,+ data=data,+ files=files,+ params=params,+ stream=stream,+ verify=self.verify_ssl,+ )def request_json(self,diff --git a/admin/client/ragflow_client.py b/admin/client/ragflow_client.pyindex 8f4f604e8f..14a56975fa 100644--- a/admin/client/ragflow_client.py+++ b/admin/client/ragflow_client.py@@ -50,6 +50,18 @@ class RAGFlowClient:self.server_type = server_typedef login_user(self, command):+ try:+ response = self.http_client.request("GET", "/system/ping", use_api_base=False, auth_kind="web")+ if response.status_code == 200 and response.content == b"pong":+ pass+ else:+ print("Server is down")+ return+ except Exception as e:+ print(str(e))+ print("Can't access server for login (connection failed)")+ return+email : str = command["email"]user_password = getpass.getpass(f"password for {email}: ").strip()try: