fix discrepancy ui
Continuous Integration / backend-tests (push) Successful in 44s
Continuous Integration / frontend-check (push) Successful in 25s
Continuous Integration / e2e-tests (push) Successful in 7m1s

This commit is contained in:
2026-05-01 23:26:29 -04:00
parent 351bc169c5
commit c303e73071
5 changed files with 28 additions and 20 deletions
+11 -1
View File
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional, Tuple
import psutil
from loguru import logger
from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import StaleDataError
from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError
from app.db import models
from app.db.database import SessionLocal
@@ -911,6 +911,16 @@ class ScannerService:
)
JobManager.complete_job(hashing_job.id)
except ObjectDeletedError:
logger.debug(
"Background hashing aborted: Job was deleted by another process"
)
# Exit gracefully - another process cancelled this job
try:
with self._metrics_lock:
self.is_hashing = False
except Exception:
pass
except Exception as e:
logger.error(f"Background hashing failed: {e}")
# Try to report failure, but don't blow up if JobManager fails too