mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
tornado: Send rendered messages to Tornado via memcached.
(imported from commit c1e8a017fa61b4e3f5c44ad4e5f59e4faf012ca3)
This commit is contained in:
@@ -171,14 +171,6 @@ class Message(models.Model):
|
||||
|
||||
@cache_with_key(lambda self, apply_markdown: 'message_dict:%d:%d' % (self.id, apply_markdown))
|
||||
def to_dict(self, apply_markdown):
|
||||
# Messages arrive in the Tornado process with the dicts already rendered.
|
||||
# This avoids running the Markdown parser and some database queries in the single-threaded
|
||||
# Tornado server.
|
||||
#
|
||||
# This field is not persisted to the database and will disappear if the object is re-fetched.
|
||||
if hasattr(self, 'precomputed_dicts'):
|
||||
return self.precomputed_dicts['text/html' if apply_markdown else 'text/x-markdown']
|
||||
|
||||
display_recipient = get_display_recipient(self.recipient)
|
||||
if self.recipient.type == Recipient.STREAM:
|
||||
display_type = "stream"
|
||||
|
||||
Reference in New Issue
Block a user