mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
push_notification: Use durable=True for the outermost transaction.
This commit updates the `transaction.atomic` context manager used to take a lock on Message row in `handle_push_notification` to use `durable=True` instead of `savepoint=False`. It helps to avoid introducing an outer transaction by mistake - resulting in locking row for a longer duration. Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
d6ce1c92b7
commit
140e575ddc
@@ -1639,7 +1639,7 @@ def handle_push_notification(user_profile_id: int, missed_message: dict[str, Any
|
||||
# BUG: Investigate why it's possible to get here.
|
||||
return # nocoverage
|
||||
|
||||
with transaction.atomic(savepoint=False):
|
||||
with transaction.atomic(durable=True):
|
||||
try:
|
||||
(message, user_message) = access_message_and_usermessage(
|
||||
user_profile,
|
||||
|
||||
Reference in New Issue
Block a user