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)