Change half-life of trend decay (#11774)

signup-info-prompt
Eugen Rochko 2019-09-08 19:17:57 +02:00 committed by GitHub
parent d7ed697030
commit a75009a65e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

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