更改:项目排行榜规则及个数

This commit is contained in:
yystopf 2023-01-04 09:19:42 +08:00
parent 0f8d2e6a5d
commit cec764127e
2 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class ProjectRankController < ApplicationController
$redis_cache.zunionstore("recent-days-project-rank", get_timeable_key_names)
deleted_data = $redis_cache.smembers("v2-project-rank-deleted")
$redis_cache.zrem("recent-days-project-rank", deleted_data) unless deleted_data.blank?
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 4, withscores: true)
@project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 9, withscores: true)
rescue Exception => e
@project_rank = []
end

View File

@ -178,6 +178,9 @@ class Project < ApplicationRecord
$redis_cache.srem("v2-project-rank-deleted", self.id)
end
end
if !self.common?
$redis_cache.srem("v2-project-rank-deleted", self.id)
end
end
def decre_project_common