]> cat aescling's git repositories - mastodon.git/commitdiff
Change half-life of trend decay (#11774)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 8 Sep 2019 17:17:57 +0000 (19:17 +0200)
committerGitHub <noreply@github.com>
Sun, 8 Sep 2019 17:17:57 +0000 (19:17 +0200)
app/models/trending_tags.rb

index e1b92b175719b68d0b1433efdd40025eb084f0d4..8cdade42d4ac83ba2cdc9f8e70827013fffb4c70 100644 (file)
@@ -7,8 +7,8 @@ class TrendingTags
   THRESHOLD            = 5
   LIMIT                = 10
   REVIEW_THRESHOLD     = 3
-  MAX_SCORE_COOLDOWN   = 3.days.freeze
-  MAX_SCORE_HALFLIFE   = 6.hours.freeze
+  MAX_SCORE_COOLDOWN   = 2.days.freeze
+  MAX_SCORE_HALFLIFE   = 2.hours.freeze
 
   class << self
     include Redisable
@@ -83,6 +83,7 @@ class TrendingTags
       # Trim older items
 
       redis.zremrangebyrank(KEY, 0, -(LIMIT + 1))
+      redis.zremrangebyscore(KEY, '(0.3', '-inf')
     end
 
     def get(limit, filtered: true)