message_flags: Update transactions to be durable in do_mark_all_as_read.

In 'do_mark_all_as_read', the transactions which mark the messages
as read in batches should be marked as durable to avoid addition
of any outer atomic block as we support marking a few batches
(not all messages) as read in the case of a timeout.
This commit is contained in:
Prakhar Pratyush 2024-08-16 15:12:31 +05:30 committed by Tim Abbott
parent 64beea2765
commit 62eb850423
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ def do_mark_all_as_read(user_profile: UserProfile, *, timeout: float | None = No
if timeout is not None and time.monotonic() >= start_time + timeout:
return None
with transaction.atomic(savepoint=False):
with transaction.atomic(durable=True):
query = (
UserMessage.select_for_update_query()
.filter(user_profile=user_profile)