feat: Expand OCR with fuel receipt scanning and maintenance extraction (#129) #147

Merged
egullickson merged 26 commits from issue-129-expand-ocr-fuel-receipt-maintenance into main 2026-02-13 02:25:55 +00:00
2 changed files with 10 additions and 5 deletions
Showing only changes of commit a078962d3f - Show all commits

View File

@@ -359,8 +359,8 @@ async def process_manual_job(job_id: str) -> None:
# Update status to processing # Update status to processing
await job_queue.update_manual_job_progress(job_id, 5, "Starting extraction") await job_queue.update_manual_job_progress(job_id, 5, "Starting extraction")
# Get job data # Get job data (must use manual-specific key prefix)
file_bytes = await job_queue.get_job_data(job_id) file_bytes = await job_queue.get_manual_job_data(job_id)
if not file_bytes: if not file_bytes:
await job_queue.fail_manual_job(job_id, "Job data not found") await job_queue.fail_manual_job(job_id, "Job data not found")
return return

View File

@@ -207,10 +207,15 @@ class JobQueue:
async def get_job_data(self, job_id: str) -> Optional[bytes]: async def get_job_data(self, job_id: str) -> Optional[bytes]:
"""Get the file data for a job.""" """Get the file data for a job."""
r = await self.get_redis() return await self._get_raw_data(f"{JOB_DATA_PREFIX}{job_id}")
data_key = f"{JOB_DATA_PREFIX}{job_id}"
# Get raw bytes (not decoded) async def get_manual_job_data(self, job_id: str) -> Optional[bytes]:
"""Get the file data for a manual extraction job."""
return await self._get_raw_data(f"{MANUAL_JOB_DATA_PREFIX}{job_id}")
async def _get_raw_data(self, data_key: str) -> Optional[bytes]:
"""Get raw binary data from Redis."""
# Need separate connection with decode_responses=False for binary data
raw_redis = redis.Redis( raw_redis = redis.Redis(
host=settings.redis_host, host=settings.redis_host,
port=settings.redis_port, port=settings.redis_port,