diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-06-22 00:39:09 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 01:04:20 -0600 |
commit | 38c7f794f1c9084be792d1b3e7e71a39b36ea090 (patch) | |
tree | 74ccdc64518afd0737ac6d714ab3a44f7491e490 /app/models | |
parent | b4d97bc26baff0a9867f1e510a7630dd34b8049d (diff) |
port tootsuite#11139 to monsterfork: Remove expensive counters from federation page in admin UI
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/instance.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/instance.rb b/app/models/instance.rb index 556ee9f70..ca72cfdc2 100644 --- a/app/models/instance.rb +++ b/app/models/instance.rb @@ -13,12 +13,8 @@ class Instance @updated_at = resource.is_a?(DomainBlock) ? resource.updated_at : 0 end - def cached_sample_accounts - Rails.cache.fetch("#{cache_key}/sample_accounts", expires_in: 12.hours) { Account.where(domain: domain).searchable.joins(:account_stat).popular.limit(3) } - end - - def cached_accounts_count - @accounts_count || Rails.cache.fetch("#{cache_key}/count", expires_in: 12.hours) { Account.where(domain: domain).count } + def countable? + @accounts_count.present? end def to_param |