about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-22 00:39:09 +0200
committerGitHub <noreply@github.com>2019-06-22 00:39:09 +0200
commit1b052c7b2d70b371648732d4d2a1d0ca3a52cab0 (patch)
treefd821991a4f8ef7dd93d69e682f386666cdc99e8 /app/models
parent707ddf7808f90e3ab042d7642d368c2ce8e95e6f (diff)
Remove expensive counters from federation page in admin UI (#11139)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/instance.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/instance.rb b/app/models/instance.rb
index a01db1212..797a191e0 100644
--- a/app/models/instance.rb
+++ b/app/models/instance.rb
@@ -11,12 +11,8 @@ class Instance
     @domain_block   = resource.is_a?(DomainBlock) ? resource : DomainBlock.rule_for(domain)
   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