From 65fffeac3f960f9c74d693525a73ac14b201bf2b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 12 Mar 2019 17:34:00 +0100 Subject: Redesign landing page (#10232) --- app/presenters/instance_presenter.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/presenters/instance_presenter.rb') diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index dc77162d4..7d7bae7ed 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -21,6 +21,10 @@ class InstancePresenter Rails.cache.fetch('user_count') { User.confirmed.joins(:account).merge(Account.without_suspended).count } end + def active_user_count + Rails.cache.fetch('active_user_count') { Redis.current.pfcount(*(0..3).map { |i| "activity:logins:#{i.weeks.ago.utc.to_date.cweek}" }) } + end + def status_count Rails.cache.fetch('local_status_count') { Account.local.joins(:account_stat).sum('account_stats.statuses_count') }.to_i end @@ -29,6 +33,10 @@ class InstancePresenter Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) } end + def sample_accounts + Rails.cache.fetch('sample_accounts', expires_in: 12.hours) { Account.local.searchable.joins(:account_stat).popular.limit(3) } + end + def version_number Mastodon::Version end -- cgit From d4ef90eae39f8c00be3dd2c6785fe9ece1f055ff Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 13 Mar 2019 21:01:57 +0900 Subject: Fix to limit to discoverable accounts. (#10253) --- app/presenters/instance_presenter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/presenters/instance_presenter.rb') diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index 7d7bae7ed..cb6005e21 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -34,7 +34,7 @@ class InstancePresenter end def sample_accounts - Rails.cache.fetch('sample_accounts', expires_in: 12.hours) { Account.local.searchable.joins(:account_stat).popular.limit(3) } + Rails.cache.fetch('sample_accounts', expires_in: 12.hours) { Account.discoverable.popular.limit(3) } end def version_number -- cgit