Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

delete_message_backend: Add `durable=True` to the outermost transaction.

Prakhar Pratyush3d597bb9b033
diff --git a/zerver/lib/retention.py b/zerver/lib/retention.py
index f18554811a6..694f8318a8a 100644
--- a/zerver/lib/retention.py
+++ b/zerver/lib/retention.py
@@ -141,7 +141,7 @@ def run_archiving(
message_count = 0
while True:
start_time = time.time()
- with transaction.atomic():
+ with transaction.atomic(savepoint=False):
archive_transaction = ArchiveTransaction.objects.create(type=type, realm=realm)
new_chunk = move_rows(
Message,
@@ -396,6 +396,7 @@ def archive_stream_messages(
logger.info("Done. Archived %s messages.", message_count)
[email protected](durable=True)
def archive_messages(chunk_size: int = MESSAGE_BATCH_SIZE) -> None:
logger.info("Starting the archiving process with chunk_size %s", chunk_size)
diff --git a/zerver/views/message_edit.py b/zerver/views/message_edit.py
index 838d40ff2bc..18a43615f41 100644
--- a/zerver/views/message_edit.py
+++ b/zerver/views/message_edit.py
@@ -167,7 +167,7 @@ def validate_can_delete_message(user_profile: UserProfile, message: Message) ->
return
[email protected](durable=True)
@typed_endpoint
def delete_message_backend(
request: HttpRequest,