From 28afc01371552449aa1adbee01ee1c575c17ff90 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Mon, 20 Jul 2026 20:03:21 +0200 Subject: [PATCH] fix(notifications): commit worker delivery transactions --- src/govoplan_core/celery_app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/govoplan_core/celery_app.py b/src/govoplan_core/celery_app.py index 8b35f94..c3ca1cd 100644 --- a/src/govoplan_core/celery_app.py +++ b/src/govoplan_core/celery_app.py @@ -121,7 +121,9 @@ def deliver_notification(self, notification_id: str): from govoplan_core.db.session import get_database with get_database().SessionLocal() as session: - return dict(_notification_dispatch().deliver_notification(session, notification_id=notification_id)) + result = dict(_notification_dispatch().deliver_notification(session, notification_id=notification_id)) + session.commit() + return result @celery.task(name="govoplan.notifications.deliver_pending", bind=True, max_retries=0) @@ -129,7 +131,9 @@ def deliver_pending_notifications(self, tenant_id: str | None = None, limit: int from govoplan_core.db.session import get_database with get_database().SessionLocal() as session: - return dict(_notification_dispatch().deliver_pending(session, tenant_id=tenant_id, limit=limit)) + result = dict(_notification_dispatch().deliver_pending(session, tenant_id=tenant_id, limit=limit)) + session.commit() + return result @celery.task(name="govoplan.calendar.dispatch_outbox", bind=True, max_retries=0)