Skip to content

Commit

Permalink
Change half-life of trend decay (mastodon#11774)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent 9be759e commit 94fe245
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/trending_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -83,6 +83,7 @@ def update!(at_time = Time.now.utc)
# Trim older items

redis.zremrangebyrank(KEY, 0, -(LIMIT + 1))
redis.zremrangebyscore(KEY, '(0.3', '-inf')
end

def get(limit, filtered: true)
Expand Down

0 comments on commit 94fe245

Please sign in to comment.