]> cat aescling's git repositories - mastodon.git/commitdiff
Fix tag score not being updated when the tag is trending (#11465)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 1 Aug 2019 17:57:09 +0000 (19:57 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Aug 2019 17:57:09 +0000 (19:57 +0200)
app/models/trending_tags.rb

index 34a4abbc5e61b107575a2755752e93f5d001738a..211c8f1dc1606ae39a05233a33026518e9800af3 100644 (file)
@@ -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)