actions: Use 'durable=True' in outermost transaction.atomic block.

We used 'savepoint=False' in #31169 which was prior to our discussion
in CZO to use 'durable=True' instead.

This commit makes changes to use 'durable=True' in the outermost
transaction.atomic block.
This commit is contained in:
Prakhar Pratyush
2024-09-03 16:53:08 +05:30
committed by Tim Abbott
parent d7761f7163
commit a2ff4f52c4
3 changed files with 4 additions and 4 deletions

View File

@@ -12,13 +12,13 @@ def notify_alert_words(user_profile: UserProfile, words: Sequence[str]) -> None:
send_event_on_commit(user_profile.realm, event, [user_profile.id])
@transaction.atomic(savepoint=False)
@transaction.atomic(durable=True)
def do_add_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) -> None:
words = add_user_alert_words(user_profile, alert_words)
notify_alert_words(user_profile, words)
@transaction.atomic(savepoint=False)
@transaction.atomic(durable=True)
def do_remove_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) -> None:
words = remove_user_alert_words(user_profile, alert_words)
notify_alert_words(user_profile, words)