about summary refs log tree commit diff
path: root/app/presenters
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-12-14 09:06:34 +0100
committerGitHub <noreply@github.com>2020-12-14 09:06:34 +0100
commit216b85b053d091306e3311a21f5b050f70a75130 (patch)
tree10a6598ad72500a7284e605336e22d36a69cdadd /app/presenters
parenta3b5675aa83f7fec4036888e0d94b626ad973f75 (diff)
Fix performance on instances list in admin UI (#15282)
- Reduce duplicate queries
- Remove n+1 queries
- Add accounts count to detailed view
- Add separate action log entry for updating existing domain blocks
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/instance_presenter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb
index c150bf742..1bfdd40ac 100644
--- a/app/presenters/instance_presenter.rb
+++ b/app/presenters/instance_presenter.rb
@@ -29,7 +29,7 @@ class InstancePresenter
   end
 
   def domain_count
-    Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
+    Rails.cache.fetch('distinct_domain_count') { Instance.count }
   end
 
   def sample_accounts