Bug Fix:Remove nil cached_tag_lists when Collecting Tags (#11648)
This commit is contained in:
parent
df31a94f2e
commit
fd97007364
1 changed files with 2 additions and 2 deletions
|
|
@ -31,10 +31,10 @@ module Follows
|
|||
last_100_long_page_view_article_ids = user.page_views.where(time_tracked_in_seconds: 45..)
|
||||
.pluck(:article_id).last(100)
|
||||
articles = Article.where(id: last_100_reactable_ids + last_100_long_page_view_article_ids)
|
||||
tags = articles.pluck(:cached_tag_list).flat_map { |list| list.split(", ") }
|
||||
tags = articles.pluck(:cached_tag_list).compact.flat_map { |list| list.split(", ") }
|
||||
occurrences = tags.count(tag.name)
|
||||
bonus = inverse_popularity_bonus(tag)
|
||||
Math.log(occurrences + bonus + 1) # +1 is purelt to avoid log(0) => -infinity
|
||||
Math.log(occurrences + bonus + 1) # +1 is purely to avoid log(0) => -infinity
|
||||
end
|
||||
|
||||
def adjust_other_tag_follows_of_user(user_id)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue