Fixed greenlet error on rollback

This commit is contained in:
Jonas Linter
2025-12-03 11:32:24 +01:00
parent 1bdef3ee11
commit 3175342cb2

View File

@@ -923,6 +923,10 @@ async def handle_webhook_unified(
)
# 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.processing_completed_at = datetime.now(UTC)