diff options
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| |