From 29609c09f4f6e50ebba60c8472e015c16275a4d2 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 1 Aug 2019 19:57:09 +0200 Subject: [PATCH] Fix tag score not being updated when the tag is trending (#11465) --- app/models/trending_tags.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/trending_tags.rb b/app/models/trending_tags.rb index 34a4abbc5e6..211c8f1dc16 100644 --- a/app/models/trending_tags.rb +++ b/app/models/trending_tags.rb @@ -49,7 +49,7 @@ class TrendingTags else score = ((observed - expected)**2) / expected added = redis.zadd(key, score, tag_id.to_s) - bump_tag_score!(tag_id) if added == 1 + bump_tag_score!(tag_id) if added end redis.expire(key, EXPIRE_TRENDS_AFTER)