From 0f8d2e6a5d1c081515cba6d48a47894940d393f7 Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 12 Dec 2022 14:25:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9Agitea-client=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 009eda921..e37371108 100644 --- a/Gemfile +++ b/Gemfile @@ -139,4 +139,4 @@ gem 'doorkeeper' gem 'doorkeeper-jwt' -gem 'gitea-client', '~> 0.10.6' \ No newline at end of file +gem 'gitea-client', '~> 0.11.1' \ No newline at end of file From cec764127e6779ef93d19404a2cefda69b4dd2e7 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 4 Jan 2023 09:19:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=8E=92=E8=A1=8C=E6=A6=9C=E8=A7=84=E5=88=99=E5=8F=8A?= =?UTF-8?q?=E4=B8=AA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/project_rank_controller.rb | 2 +- app/models/project.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/project_rank_controller.rb b/app/controllers/project_rank_controller.rb index 7bd62987e..8584d070f 100644 --- a/app/controllers/project_rank_controller.rb +++ b/app/controllers/project_rank_controller.rb @@ -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 diff --git a/app/models/project.rb b/app/models/project.rb index 31da85252..dbe8469df 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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