mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
django_api: Rename 'send_event' to 'send_event_rollback_unsafe'.
This commit renames the 'send_event' function to 'send_event_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.
This commit is contained in:
committed by
Tim Abbott
parent
8e71806958
commit
e763d065a3
@@ -488,9 +488,9 @@ class DeleteMessageTest(ZulipTestCase):
|
||||
|
||||
def test_delete_event_sent_after_transaction_commits(self) -> None:
|
||||
"""
|
||||
Tests that `send_event` is hooked to `transaction.on_commit`. This is important, because
|
||||
we don't want to end up holding locks on message rows for too long if the event queue runs
|
||||
into a problem.
|
||||
Tests that `send_event_rollback_unsafe` is hooked to `transaction.on_commit`.
|
||||
This is important, because we don't want to end up holding locks on message rows
|
||||
for too long if the event queue runs into a problem.
|
||||
"""
|
||||
hamlet = self.example_user("hamlet")
|
||||
self.send_stream_message(hamlet, "Denmark")
|
||||
|
||||
Reference in New Issue
Block a user