Added/removed some functionality to better handle requests/load

- Removed status counting in dashboard for admins
- Added limit to notifications to only 7 days ago
- Removed ability for non-logged in users to view group, group-collection timelines
- Limited account realtime search on compose, list, chat actions
- Removed fetching of user suggestions
- Removed fetching of shortcuts
- Removed featured groups, user suggestions timeline injections
- Removed group featured panel from explore layout for non logged in users
- Removed media gallery panel from profile layout
- Removed lists, suggestions, groups panel from home page
- Removed user suggestions to list page
- Updated pro_timelie in status.rb to find only from 1 hour ago
- Updated home timeline to not include groups and to find only latest from 5 days ago
- Removed search for non logged in users
This commit is contained in:
mgabdev
2021-01-08 21:46:03 -05:00
parent c1213f4137
commit f4512b4411
20 changed files with 35 additions and 26 deletions

View File

@@ -42,6 +42,7 @@ class Notification < ApplicationRecord
validates :account_id, uniqueness: { scope: [:activity_type, :activity_id] }
validates :activity_type, inclusion: { in: TYPE_CLASS_MAP.values }
scope :latest, -> { where('created_at < ?', 7.days.ago) }
scope :browserable, ->(exclude_types = [], account_id = nil, only_verified = false, only_following = false) {
types = TYPE_CLASS_MAP.values - activity_types_from_types(exclude_types + [:follow_request])

View File

@@ -290,12 +290,7 @@ class Status < ApplicationRecord
end
def as_home_timeline(account)
query = where('created_at > ?', 21.days.ago)
query.where(visibility: [:public, :unlisted]).or(
where(visibility: [:private]).where('group is null')
).or(
where(visibility: [:private]).where(group: account.groups)
)
query = where('created_at > ?', 5.days.ago)
query.where(account: [account] + account.following).without_replies
end
@@ -309,7 +304,7 @@ class Status < ApplicationRecord
end
def as_pro_timeline(account = nil)
query = timeline_scope.without_replies.popular_accounts.where('statuses.updated_at > ?', 2.hours.ago)
query = timeline_scope.without_replies.popular_accounts.where('statuses.updated_at > ?', 1.hours.ago)
apply_timeline_filters(query, account)
end