diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /app/services/projects/unlink_fork_service.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'app/services/projects/unlink_fork_service.rb')
-rw-r--r-- | app/services/projects/unlink_fork_service.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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| |