refactor: remove db.commit() from audit_service.log_action, all callers use UoW
This commit is contained in:
@@ -12,8 +12,6 @@ Services should **never** call ``db.commit()``; they use ``db.add()`` /
|
||||
``db.flush()`` to stage work and let the caller decide when to commit.
|
||||
|
||||
**Documented exceptions** (services that may commit internally):
|
||||
- ``audit_service.log_action`` — called from 15+ routers; commits to ensure
|
||||
audit records persist even when callers do not.
|
||||
- Import services (atomic_import, sigma_import, etc.) — self-contained sync ops.
|
||||
- Background jobs (campaign_scheduler, intel_service, stale_detection,
|
||||
mitre_sync) — self-contained operations.
|
||||
|
||||
Reference in New Issue
Block a user