Commit 255b4e83 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update ofd_parse.py

parent 3cfc9159
...@@ -104,13 +104,13 @@ class ocrOfdClient: ...@@ -104,13 +104,13 @@ class ocrOfdClient:
try: try:
response = requests.get(health_check_url) response = requests.get(health_check_url)
if response.status_code == 200: if response.status_code == 200:
logger.info("Server is healthy and ready to process requests.") logger.info("ofd Server is healthy and ready to process requests.")
return True return True
else: else:
logger.error(f'Server health check failed with status code:{response.status_code}') logger.error(f'ofd Server health check failed with status code:{response.status_code}')
return False return False
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
logger.error(f'Health check request failed:{e}') logger.error(f'ofd Health check request failed:{e}')
return False return False
def parse_ofd(self,config_path,file_path,output_dir): def parse_ofd(self,config_path,file_path,output_dir):
...@@ -121,6 +121,7 @@ class ocrOfdClient: ...@@ -121,6 +121,7 @@ class ocrOfdClient:
"config_path": str(config_path), "config_path": str(config_path),
} }
# 发送 POST 请求 # 发送 POST 请求
logger.info(f'data:{data}')
response = requests.post(f"{self.api_url}/ofd_ocr", json=data) response = requests.post(f"{self.api_url}/ofd_ocr", json=data)
# 处理响应 # 处理响应
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment