diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2021-12-14 07:21:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 23:21:14 +0100 |
commit | bda8e4f815708bd4deeb3c2310732e0b7a4e15e8 (patch) | |
tree | 1527b1e3e410f5d713be783b34bf8a9c4ecc4844 /app/workers | |
parent | 0fc73bbcb937d62c47a37325794825c77ef8a8a7 (diff) |
Fix follow recommendation biased towards older accounts (#17126)
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/scheduler/follow_recommendations_scheduler.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/scheduler/follow_recommendations_scheduler.rb b/app/workers/scheduler/follow_recommendations_scheduler.rb index cb1e15961..effc63e59 100644 --- a/app/workers/scheduler/follow_recommendations_scheduler.rb +++ b/app/workers/scheduler/follow_recommendations_scheduler.rb @@ -16,12 +16,12 @@ class Scheduler::FollowRecommendationsScheduler AccountSummary.refresh FollowRecommendation.refresh - fallback_recommendations = FollowRecommendation.limit(SET_SIZE).index_by(&:account_id) + fallback_recommendations = FollowRecommendation.order(rank: :desc).limit(SET_SIZE).index_by(&:account_id) I18n.available_locales.each do |locale| recommendations = begin if AccountSummary.safe.filtered.localized(locale).exists? # We can skip the work if no accounts with that language exist - FollowRecommendation.localized(locale).limit(SET_SIZE).index_by(&:account_id) + FollowRecommendation.localized(locale).order(rank: :desc).limit(SET_SIZE).index_by(&:account_id) else {} end |