fix(ocr): sync workflow steps with process_with_ocr replacing legacy azure step
- Update _compute_processing_flow to recognize process_with_ocr as the OCR stage and remap legacy process_with_azure_document_intelligence log entries for backward compatibility - Normalize legacy OCR step name in _compute_step_summary log fallback - Add process_with_ocr to REAL_MAIN_STEPS/REAL_STEPS in step_manager, file_status, and file_queries (keeping legacy name for old DB entries) - Update retry logic in api/files.py to retry failed OCR via process_with_ocr (handles both step names as aliases) - Fix process_document.py to log process_with_ocr as skipped (not azure step) for the local text extraction path Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -201,10 +201,13 @@ def get_file_overall_status(db: Session, file_id: int) -> Dict:
|
||||
|
||||
# Define which steps are "real" status-determining steps
|
||||
# Only high-level logical steps, not implementation sub-steps
|
||||
# Both process_with_ocr (current) and process_with_azure_document_intelligence (legacy)
|
||||
# are included to correctly count steps for files processed before the OCR abstraction.
|
||||
REAL_MAIN_STEPS = {
|
||||
"create_file_record",
|
||||
"check_text",
|
||||
"extract_text",
|
||||
"process_with_ocr",
|
||||
"process_with_azure_document_intelligence",
|
||||
"extract_metadata_with_gpt",
|
||||
"embed_metadata_into_pdf",
|
||||
@@ -286,10 +289,13 @@ def get_step_summary(db: Session, file_id: int) -> Dict:
|
||||
"""
|
||||
# Define which steps are "real" status-determining steps
|
||||
# Only high-level logical steps, not implementation sub-steps
|
||||
# Both process_with_ocr (current) and process_with_azure_document_intelligence (legacy)
|
||||
# are included to correctly count steps for files processed before the OCR abstraction.
|
||||
REAL_MAIN_STEPS = {
|
||||
"create_file_record",
|
||||
"check_text",
|
||||
"extract_text",
|
||||
"process_with_ocr",
|
||||
"process_with_azure_document_intelligence",
|
||||
"extract_metadata_with_gpt",
|
||||
"embed_metadata_into_pdf",
|
||||
|
||||
Reference in New Issue
Block a user