mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
queue: Rename queue_json_publish to queue_json_publish_rollback_unsafe.
This commit renames the 'queue_json_publish' function to 'queue_json_publish_rollback_unsafe' to reflect the fact that it doesn't wait for the db transaction (within which it gets called, if any) to commit and sends event irrespective of commit or rollback. In most of the cases we don't want to send event in the case of rollbacks, so the caller should be aware that calling the function directly is rollback unsafe. Fixes part of #30489.
This commit is contained in:
committed by
Tim Abbott
parent
1847086044
commit
3bad36ef8c
@@ -17,7 +17,7 @@ from zerver.context_processors import common_context
|
||||
from zerver.lib.email_notifications import build_message_list
|
||||
from zerver.lib.logging_util import log_to_file
|
||||
from zerver.lib.message import get_last_message_id
|
||||
from zerver.lib.queue import queue_json_publish
|
||||
from zerver.lib.queue import queue_json_publish_rollback_unsafe
|
||||
from zerver.lib.send_email import FromAddress, send_future_email
|
||||
from zerver.lib.url_encoding import stream_narrow_url
|
||||
from zerver.models import (
|
||||
@@ -92,7 +92,7 @@ class DigestTopic:
|
||||
def queue_digest_user_ids(user_ids: list[int], cutoff: datetime) -> None:
|
||||
# Convert cutoff to epoch seconds for transit.
|
||||
event = {"user_ids": user_ids, "cutoff": cutoff.strftime("%s")}
|
||||
queue_json_publish("digest_emails", event)
|
||||
queue_json_publish_rollback_unsafe("digest_emails", event)
|
||||
|
||||
|
||||
def enqueue_emails(cutoff: datetime) -> None:
|
||||
|
||||
Reference in New Issue
Block a user