diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-23 06:11:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-23 06:11:52 +0300 |
commit | 4822d600e3cb07336ac7593a2f4109e31516d434 (patch) | |
tree | 97a92f7168064e3cb7a52a5f7cc20d535e99e485 /app/services/projects | |
parent | 5a21d6fde31839caf228d031faabb8c3a8e7cf7c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/destroy_service.rb | 2 | ||||
-rw-r--r-- | app/services/projects/unlink_fork_service.rb | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index 8c86646ba5c..7ba5b6119b9 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -34,7 +34,7 @@ module Projects ::Ci::AbortPipelinesService.new.execute(project.all_pipelines, :project_deleted) - Projects::UnlinkForkService.new(project, current_user).execute + Projects::UnlinkForkService.new(project, current_user).execute(refresh_statistics: false) attempt_destroy(project) diff --git a/app/services/projects/unlink_fork_service.rb b/app/services/projects/unlink_fork_service.rb index 898421364db..cdd1870858e 100644 --- a/app/services/projects/unlink_fork_service.rb +++ b/app/services/projects/unlink_fork_service.rb @@ -3,7 +3,7 @@ module Projects class UnlinkForkService < BaseService # Close existing MRs coming from the project and remove it from the fork network - def execute + def execute(refresh_statistics: true) fork_network = @project.fork_network forked_from = @project.forked_from_project @@ -46,6 +46,10 @@ module Projects end # rubocop: enable Cop/InBatches + if Feature.enabled?(:refresh_statistics_on_unlink_fork, @project.namespace) && refresh_statistics + ProjectCacheWorker.perform_async(project.id, [], [:repository_size]) + end + # When the project getting out of the network is a node with parent # and children, both the parent and the node needs a cache refresh. [forked_from, @project].compact.each do |project| |