Use Account.local.sum(statuses_count) instead of Status.local.count (#4996)

It is faster.
signup-info-prompt
Akihiko Odaki 2017-09-18 21:59:57 +09:00 committed by Eugen Rochko
parent 66be6475b6
commit 9619b7f727
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class InstancePresenter
end
def status_count
Rails.cache.fetch('local_status_count') { Status.local.count }
Rails.cache.fetch('local_status_count') { Account.local.sum(:statuses_count) }
end
def domain_count