fix: DB-Rollback nach LLM-Fehler im Rationale-Backfill
Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Failing after 42s
CI/CD / test-python-backend-compliance (push) Successful in 32s
CI/CD / test-python-document-crawler (push) Successful in 22s
CI/CD / test-python-dsms-gateway (push) Successful in 18s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Has been skipped

Verhindert 'invalid transaction' Fehler wenn ein LLM-Call fehlschlaegt
und nachfolgende DB-Operationen blockiert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-25 23:51:27 +01:00
parent 564f93259b
commit cb034b8009

View File

@@ -1259,6 +1259,11 @@ async def backfill_rationale(
"control_id": parent.control_id, "control_id": parent.control_id,
"error": str(e)[:200], "error": str(e)[:200],
}) })
# Rollback um DB-Session nach Fehler nutzbar zu halten
try:
db.rollback()
except Exception:
pass
db.commit() db.commit()