Fixed greenlet error on rollback

This commit is contained in:
Jonas Linter
2025-12-03 11:32:24 +01:00
parent df7d3c6543
commit 78f81d6b97

View File

@@ -923,6 +923,10 @@ async def handle_webhook_unified(
) )
# 8. Update status and link created entities when available # 8. Update status and link created entities when available
# Re-add to session in case processor called rollback (e.g., for duplicates)
if webhook_request not in db_session:
webhook_request = await db_session.merge(webhook_request)
webhook_request.status = WebhookStatus.COMPLETED webhook_request.status = WebhookStatus.COMPLETED
webhook_request.processing_completed_at = datetime.now(UTC) webhook_request.processing_completed_at = datetime.now(UTC)