refactor: remove db.commit() from business services, callers use UnitOfWork (Tier 3)

This commit is contained in:
2026-02-20 14:42:20 +01:00
parent 339d669498
commit 14d995b40c
7 changed files with 48 additions and 33 deletions

View File

@@ -181,12 +181,10 @@ def get_osint_items_for_technique(
def mark_osint_reviewed(db: Session, item_id: str) -> OsintItem | None:
"""Mark an OSINT item as reviewed."""
"""Mark an OSINT item as reviewed. Does not commit; caller uses UnitOfWork."""
item = db.query(OsintItem).filter(OsintItem.id == item_id).first()
if item:
item.reviewed = True
db.commit()
db.refresh(item)
return item

View File

@@ -82,9 +82,7 @@ def update_scoring_weights(
row.weight_freshness = new.freshness
row.weight_platform_diversity = new.platform_diversity
db.commit()
db.refresh(row)
# Does not commit; caller (router) uses UnitOfWork.
return _weights_dict(new)

View File

@@ -39,8 +39,7 @@ def create_worklog(
)
wl.integrity_hash = _compute_hash(wl)
db.add(wl)
db.commit()
db.refresh(wl)
# Does not commit; caller (router) uses UnitOfWork.
return wl