mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 16:43:57 +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
@@ -6,7 +6,7 @@ import orjson
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.lib.management import ZulipBaseCommand
|
||||
from zerver.lib.queue import queue_json_publish
|
||||
from zerver.lib.queue import queue_json_publish_rollback_unsafe
|
||||
|
||||
|
||||
def error(*args: Any) -> None:
|
||||
@@ -28,7 +28,7 @@ def enqueue_file(queue_name: str, f: IO[str]) -> None:
|
||||
|
||||
# This is designed to use the `error` method rather than
|
||||
# the call_consume_in_tests flow.
|
||||
queue_json_publish(queue_name, data, error)
|
||||
queue_json_publish_rollback_unsafe(queue_name, data, error)
|
||||
|
||||
|
||||
class Command(ZulipBaseCommand):
|
||||
|
||||
Reference in New Issue
Block a user