From cebf17caaa7028422822ccb8a678f5ecb6130715 Mon Sep 17 00:00:00 2001 From: Groupr Date: Sat, 7 Jun 2025 16:00:31 +0000 Subject: [PATCH 1/3] Update notify.py --- remarkbox/lib/notify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remarkbox/lib/notify.py b/remarkbox/lib/notify.py index 04f14ab..d292d89 100644 --- a/remarkbox/lib/notify.py +++ b/remarkbox/lib/notify.py @@ -166,7 +166,8 @@ def deliver_scheduled_notifications(request=None): if datetime.today().weekday() == 0: notification_dict = get_email_notifications(request.dbsession, "weekly") send_digest_notifications(request, notification_dict, "weekly") - + + tm.commit() def send_immediate_notifications(request, notifications): deliver_email_notifications = request.app.get("deliver_email_notifications", True) From 266189ce9ba4d9151342b266836fd83bc7305df3 Mon Sep 17 00:00:00 2001 From: Groupr Date: Sat, 7 Jun 2025 16:07:44 +0000 Subject: [PATCH 2/3] Update notify.py --- remarkbox/lib/notify.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/remarkbox/lib/notify.py b/remarkbox/lib/notify.py index d292d89..0685be6 100644 --- a/remarkbox/lib/notify.py +++ b/remarkbox/lib/notify.py @@ -166,8 +166,7 @@ def deliver_scheduled_notifications(request=None): if datetime.today().weekday() == 0: notification_dict = get_email_notifications(request.dbsession, "weekly") send_digest_notifications(request, notification_dict, "weekly") - - tm.commit() + def send_immediate_notifications(request, notifications): deliver_email_notifications = request.app.get("deliver_email_notifications", True) From acb7e612b9c63ef065ab3fd2bd33626855bc3a3f Mon Sep 17 00:00:00 2001 From: Groupr Date: Sat, 7 Jun 2025 16:14:54 +0000 Subject: [PATCH 3/3] Update send_node_digest_notifications.py --- .../scripts/send_node_digest_notifications.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/remarkbox/scripts/send_node_digest_notifications.py b/remarkbox/scripts/send_node_digest_notifications.py index cd684c0..6de10f2 100644 --- a/remarkbox/scripts/send_node_digest_notifications.py +++ b/remarkbox/scripts/send_node_digest_notifications.py @@ -15,13 +15,17 @@ def main(): setup_logging(args.config) with bootstrap(args.config) as env: - try: - deliver_scheduled_notifications() - print("Notifications processed successfully.") - raise SystemExit(0) - except Exception as e: - print("Error processing notifications:", str(e)) - raise SystemExit(1) + request = env["request"] + with request.tm: + try: + deliver_scheduled_notifications() + print("Notifications processed successfully.") + transaction.commit() + raise SystemExit(0) + except Exception as e: + print("Error processing notifications:", str(e)) + transaction.abort() + raise SystemExit(1) if __name__ == "__main__": main()