Revertしたコミットを復元
This commit is contained in:
parent
76598bd542
commit
b3c2e47ea8
3 changed files with 16 additions and 24 deletions
|
@ -1,10 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Reverted this commit.temporarily because load issues.
|
||||
# Whenever a manual merge occurs, be sure to check the following commits.
|
||||
# Hash: ee8d0b94473df357677cd1f82581251ce0423c01
|
||||
# Message: Fix follow suggestions potentially including silenced or blocked accounts (#29306)
|
||||
|
||||
class AccountSuggestions::SimilarProfilesSource < AccountSuggestions::Source
|
||||
class QueryBuilder < AccountSearchService::QueryBuilder
|
||||
def must_clauses
|
||||
|
@ -56,7 +51,8 @@ class AccountSuggestions::SimilarProfilesSource < AccountSuggestions::Source
|
|||
recently_followed_account_ids = account.active_relationships.recent.limit(5).pluck(:target_account_id)
|
||||
|
||||
if Chewy.enabled? && !recently_followed_account_ids.empty?
|
||||
QueryBuilder.new(recently_followed_account_ids, account).build.limit(limit).hits.pluck('_id').map(&:to_i).zip([key].cycle)
|
||||
ids_from_es = QueryBuilder.new(recently_followed_account_ids, account).build.limit(limit).hits.pluck('_id').map(&:to_i)
|
||||
base_account_scope(account).where(id: ids_from_es).pluck(:id).zip([key].cycle)
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Reverted this commit.temporarily because load issues.
|
||||
# Whenever a manual merge occurs, be sure to check the following commits.
|
||||
# Hash: ee8d0b94473df357677cd1f82581251ce0423c01
|
||||
# Message: Fix follow suggestions potentially including silenced or blocked accounts (#29306)
|
||||
|
||||
class AccountSuggestions::Source
|
||||
DEFAULT_LIMIT = 10
|
||||
|
||||
|
@ -17,6 +12,8 @@ class AccountSuggestions::Source
|
|||
def base_account_scope(account)
|
||||
Account
|
||||
.searchable
|
||||
.where(discoverable: true)
|
||||
.without_silenced
|
||||
.where.not(follows_sql, id: account.id)
|
||||
.where.not(follow_requests_sql, id: account.id)
|
||||
.not_excluded_by_account(account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue