Auto-commit: OCR workflow improvements, performance optimizations, and bug fixes
This commit is contained in:
@@ -1,34 +1,24 @@
|
||||
import requests
|
||||
import sys
|
||||
import time
|
||||
|
||||
print('Testing server status and OCR upload...')
|
||||
def check_server():
|
||||
url = "http://localhost:3015/health"
|
||||
try:
|
||||
response = requests.get(url, timeout=10)
|
||||
print(f"Server is running. Status: {response.status_code}")
|
||||
print(f"Response: {response.text}")
|
||||
return True
|
||||
except requests.exceptions.ConnectionError:
|
||||
print("Server is not running or not accessible on port 3015")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"Error checking server: {e}")
|
||||
return False
|
||||
|
||||
# Test server status
|
||||
try:
|
||||
response = requests.get('http://localhost:3015/')
|
||||
print(f'Server root status: {response.status_code}')
|
||||
except Exception as e:
|
||||
print(f'Server root error: {e}')
|
||||
|
||||
# Login
|
||||
login_data = {'username': 'jleu3482', 'password': 'jleu1212'}
|
||||
login_response = requests.post('http://localhost:3015/login', data=login_data)
|
||||
print(f'Login status: {login_response.status_code}')
|
||||
|
||||
if login_response.status_code == 200:
|
||||
token = login_response.json().get('access_token')
|
||||
headers = {'Authorization': f'Bearer {token}'}
|
||||
print('✓ Login successful')
|
||||
|
||||
# Check current documents
|
||||
docs_response = requests.get('http://localhost:3015/documents', headers=headers)
|
||||
print(f'Documents status: {docs_response.status_code}')
|
||||
if docs_response.status_code == 200:
|
||||
docs = docs_response.json()
|
||||
statuses = docs.get('statuses', {})
|
||||
print(f'Current document status:')
|
||||
print(f' Completed: {len(statuses.get("completed", []))}')
|
||||
print(f' Processing: {len(statuses.get("processing", []))}')
|
||||
print(f' Failed: {len(statuses.get("failed", []))}')
|
||||
else:
|
||||
print(f'Login failed: {login_response.text}')
|
||||
if __name__ == "__main__":
|
||||
print("Checking LightRAG server status...")
|
||||
if check_server():
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user