From 38c7f794f1c9084be792d1b3e7e71a39b36ea090 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 22 Jun 2019 00:39:09 +0200 Subject: port tootsuite#11139 to monsterfork: Remove expensive counters from federation page in admin UI --- app/models/instance.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/models') 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 -- cgit