From 23fc04577b7975a22ac5e5f38f8f7ecbaf6dd698 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Thu, 29 Feb 2024 09:15:31 +0530 Subject: [PATCH] message_send: Don't create savepoint in do_send_messages. In general, we never want to use savepoints. This prep commit adds savepoint=False in do_send_messages as we don't want to just rollback to this savepoint and proceed if we encounter any error while sending zulip updates via cron. --- zerver/actions/message_send.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/actions/message_send.py b/zerver/actions/message_send.py index d58a8279a5..a6565b6da7 100644 --- a/zerver/actions/message_send.py +++ b/zerver/actions/message_send.py @@ -865,7 +865,7 @@ def do_send_messages( # Save the message receipts in the database user_message_flags: Dict[int, Dict[int, List[str]]] = defaultdict(dict) - with transaction.atomic(): + with transaction.atomic(savepoint=False): Message.objects.bulk_create(send_request.message for send_request in send_message_requests) # Claim attachments in message