0
0
Fork 0

Add entity cache (#7271)

* Add entity cache

Use a caching layer for mentions and custom emojis that are
dynamically extracted from text.

Reduce duplicate text extractions

* Fix code style issue
This commit is contained in:
Eugen Rochko 2018-04-27 01:38:10 +02:00 committed by GitHub
parent 63553c6b5c
commit a872392cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 10 deletions

View file

@ -160,7 +160,7 @@ class Status < ApplicationRecord
end
def emojis
CustomEmoji.from_text([spoiler_text, text].join(' '), account.domain)
@emojis ||= CustomEmoji.from_text([spoiler_text, text].join(' '), account.domain)
end
after_create_commit :store_uri, if: :local?