File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
surfsense_backend/app/tasks/document_processors Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 44
55import contextlib
66import logging
7+ import warnings
8+ from logging import ERROR , getLogger
79
810from fastapi import HTTPException
911from langchain_core .documents import Document as LangChainDocument
@@ -886,8 +888,6 @@ async def process_file_in_background(
886888 )
887889
888890 # Use Docling service for document processing
889- import warnings
890-
891891 from app .services .docling_service import create_docling_service
892892
893893 # Create Docling service
@@ -896,7 +896,7 @@ async def process_file_in_background(
896896 # Suppress pdfminer warnings that can cause processing to hang
897897 # These warnings are harmless but can spam logs and potentially halt processing
898898 # Suppress both Python warnings and logging warnings from pdfminer
899- pdfminer_logger = logging . getLogger ("pdfminer" )
899+ pdfminer_logger = getLogger ("pdfminer" )
900900 original_level = pdfminer_logger .level
901901
902902 with warnings .catch_warnings ():
@@ -912,7 +912,7 @@ async def process_file_in_background(
912912 )
913913
914914 # Temporarily suppress pdfminer logging warnings
915- pdfminer_logger .setLevel (logging . ERROR )
915+ pdfminer_logger .setLevel (ERROR )
916916
917917 try :
918918 # Process the document
You can’t perform that action at this time.
0 commit comments