fix: Lint fixes of services
All checks were successful
Backend CI / test (push) Successful in 3m59s

This commit is contained in:
JSC
2025-08-01 01:27:47 +02:00
parent 95ccb76233
commit a10111793c
12 changed files with 237 additions and 160 deletions

View File

@@ -1,6 +1,7 @@
"""Background extraction processor for handling extraction queue."""
import asyncio
import contextlib
from sqlmodel.ext.asyncio.session import AsyncSession
@@ -51,10 +52,8 @@ class ExtractionProcessor:
"Extraction processor did not stop gracefully, cancelling...",
)
self.processor_task.cancel()
try:
with contextlib.suppress(asyncio.CancelledError):
await self.processor_task
except asyncio.CancelledError:
pass
logger.info("Extraction processor stopped")
@@ -84,8 +83,8 @@ class ExtractionProcessor:
except TimeoutError:
continue # Continue processing
except Exception as e:
logger.exception("Error in extraction queue processor: %s", e)
except Exception:
logger.exception("Error in extraction queue processor")
# Wait a bit before retrying to avoid tight error loops
try:
await asyncio.wait_for(self.shutdown_event.wait(), timeout=10.0)
@@ -156,8 +155,8 @@ class ExtractionProcessor:
result["status"],
)
except Exception as e:
logger.exception("Error processing extraction %d: %s", extraction_id, e)
except Exception:
logger.exception("Error processing extraction %d", extraction_id)
def _on_extraction_completed(self, extraction_id: int, task: asyncio.Task) -> None:
"""Handle completion of an extraction task."""