From 7f8aac4d28f88133ae8f594cece8b6405db0b989 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 21 Jun 2024 15:46:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?release=20=E5=8F=AF=E4=B8=8D=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/version_releases_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/version_releases_controller.rb b/app/controllers/version_releases_controller.rb index 93aece8f..dd80bf6a 100644 --- a/app/controllers/version_releases_controller.rb +++ b/app/controllers/version_releases_controller.rb @@ -2,7 +2,7 @@ class VersionReleasesController < ApplicationController include ApplicationHelper before_action :load_repository before_action :set_user - before_action :require_login, except: [:index, :show] + before_action :require_login, except: [:index, :show, :download] before_action :check_release_authorize, except: [:index, :show, :download] before_action :find_version , only: [:show, :edit, :update, :destroy] From bad7be4266337a395c8f54491ef363ed23ac06db Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 24 Jun 2024 20:53:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=A7=BB=E9=99=A4=E6=8E=92=E8=A1=8C=E6=A6=9C=E9=98=9F?= =?UTF-8?q?=E5=88=97=E5=BB=B6=E8=BF=9F=E4=BA=94=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index c5fb448a..de57d88e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -181,14 +181,14 @@ class Project < ApplicationRecord end if changes[:is_public].present? if changes[:is_public][0] && !changes[:is_public][1] - CacheAsyncClearJob.perform_later('project_rank_service', self.id) + CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id) end if !changes[:is_public][0] && changes[:is_public][1] $redis_cache.srem("v2-project-rank-deleted", self.id) end end if !self.common? - CacheAsyncClearJob.perform_later('project_rank_service', self.id) + CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id) end end From a6868e8b1298508e4733f4551dd31921e93ca28a Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 24 Jun 2024 21:00:33 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Aid=E4=B8=BAnil?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/cache_async_clear_job.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/jobs/cache_async_clear_job.rb b/app/jobs/cache_async_clear_job.rb index 1d810781..589876bc 100644 --- a/app/jobs/cache_async_clear_job.rb +++ b/app/jobs/cache_async_clear_job.rb @@ -2,6 +2,7 @@ class CacheAsyncClearJob < ApplicationJob queue_as :cache def perform(type, id=nil) + return if id.nil? case type when "project_common_service" Cache::V2::ProjectCommonService.new(id).clear From 26263ba5bb4aba2d8bd74d1b4b7eb56ef4df3b76 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 27 Jun 2024 09:13:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/projects_rank_controller.rb | 2 +- app/views/admins/projects_rank/shared/_data_list.html.erb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/admins/projects_rank_controller.rb b/app/controllers/admins/projects_rank_controller.rb index 8db0961b..9e7df34f 100644 --- a/app/controllers/admins/projects_rank_controller.rb +++ b/app/controllers/admins/projects_rank_controller.rb @@ -10,7 +10,7 @@ class Admins::ProjectsRankController < Admins::BaseController sum(issues) as issues, sum(pullrequests) as pullrequests, sum(commits) as commits").includes(:project) - @statistics = @statistics.order("#{sort_by} #{sort_direction}") + @statistics = paginate @statistics.order("#{sort_by} #{sort_direction}") export_excel(@statistics.limit(50)) end diff --git a/app/views/admins/projects_rank/shared/_data_list.html.erb b/app/views/admins/projects_rank/shared/_data_list.html.erb index e95cfdef..1437a27c 100644 --- a/app/views/admins/projects_rank/shared/_data_list.html.erb +++ b/app/views/admins/projects_rank/shared/_data_list.html.erb @@ -34,4 +34,6 @@ <% end %> - \ No newline at end of file + + + <%= render partial: 'admins/shared/paginate', locals: { objects: statistics } %> \ No newline at end of file