diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-08 19:17:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-08 19:17:57 +0200 |
commit | a75009a65e1335047dff5488b4e67bdc03677590 (patch) | |
tree | ace019efb41dd1308a4cd59a6b779d062872decf /app/models | |
parent | d7ed6970302316aa09e49049031bee6f07da5680 (diff) |
Change half-life of trend decay (#11774)
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/trending_tags.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/trending_tags.rb b/app/models/trending_tags.rb index e1b92b175..8cdade42d 100644 --- a/app/models/trending_tags.rb +++ b/app/models/trending_tags.rb @@ -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) |