fix: multi-worker translation status and OCR fallback handling

Translation status (multi-worker support):
- Add filesystem lock files (.translating) to track in-progress translations
- Check lock files in /status API when job_state not found in current worker
- Remove lock files on translation success or failure

OCR fallback fix:
- Fix empty pages when layout analysis fails but OCR succeeds
- Change 'enhanced_results' in ocr_results to ocr_results.get('enhanced_results')
- This ensures fallback to text_regions when enhanced_results is empty list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-14 16:36:36 +08:00
parent 1c37585be2
commit 3ccbdb8394
4 changed files with 36 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ FRONTEND_PORT=${FRONTEND_PORT:-5173}
# Production settings
PROD_MODE=false
# Translation status uses filesystem lock files for multi-worker support
UVICORN_WORKERS=${UVICORN_WORKERS:-4}
# Create PID directory