From 4f53994470dba09a56b41c1eb63ec98972a478e0 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 28 Oct 2021 16:33:30 +0800 Subject: [PATCH] fix: rank count --- app/controllers/project_rank_controller.rb | 2 +- app/controllers/user_rank_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/project_rank_controller.rb b/app/controllers/project_rank_controller.rb index 07bc2fb0f..d2477b331 100644 --- a/app/controllers/project_rank_controller.rb +++ b/app/controllers/project_rank_controller.rb @@ -2,7 +2,7 @@ class ProjectRankController < ApplicationController # 根据时间获取热门项目 def index $redis_cache.zunionstore("recent-days-project-rank", get_timeable_key_names) - @project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 5, withscores: true) + @project_rank = $redis_cache.zrevrange("recent-days-project-rank", 0, 4, withscores: true) rescue Exception => e @project_rack = [] end diff --git a/app/controllers/user_rank_controller.rb b/app/controllers/user_rank_controller.rb index 734b94c84..dddca485c 100644 --- a/app/controllers/user_rank_controller.rb +++ b/app/controllers/user_rank_controller.rb @@ -2,7 +2,7 @@ class UserRankController < ApplicationController # 根据时间获取热门开发者 def index $redis_cache.zunionstore("recent-days-user-rank", get_timeable_key_names) - @user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, 5, withscores: true) + @user_rank = $redis_cache.zrevrange("recent-days-user-rank", 0, 3, withscores: true) rescue Exception => e @user_rank = [] end