summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/git_push_service.rb10
-rw-r--r--app/services/git_tag_push_service.rb6
2 files changed, 10 insertions, 6 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 29c8ce5fea3..05073e9976f 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -20,7 +20,7 @@ class GitPushService < BaseService
# 5. Executes the project's services
# 6. Checks if the project's main language has changed
#
- def execute
+ def execute(update_statistics: true)
@project.repository.after_create if @project.empty_repo?
@project.repository.after_push_commit(branch_name)
@@ -58,7 +58,7 @@ class GitPushService < BaseService
perform_housekeeping
update_remote_mirrors
- update_caches
+ update_caches(update_statistics)
update_signatures
end
@@ -67,7 +67,7 @@ class GitPushService < BaseService
@project.repository.copy_gitattributes(params[:ref])
end
- def update_caches
+ def update_caches(update_statistics)
if default_branch?
if push_to_new_branch?
# If this is the initial push into the default branch, the file type caches
@@ -88,7 +88,9 @@ class GitPushService < BaseService
types = []
end
- ProjectCacheWorker.perform_async(@project.id, types, [:commit_count, :repository_size])
+ if update_statistics || types.any?
+ ProjectCacheWorker.perform_async(@project.id, types, [:commit_count, :repository_size])
+ end
end
def update_signatures
diff --git a/app/services/git_tag_push_service.rb b/app/services/git_tag_push_service.rb
index 3ff2d1d107d..60c8d91e7a1 100644
--- a/app/services/git_tag_push_service.rb
+++ b/app/services/git_tag_push_service.rb
@@ -3,7 +3,7 @@
class GitTagPushService < BaseService
attr_accessor :push_data
- def execute
+ def execute(update_statistics: true)
project.repository.after_create if project.empty_repo?
project.repository.before_push_tag
@@ -16,7 +16,9 @@ class GitTagPushService < BaseService
project.execute_hooks(@push_data.dup, :tag_push_hooks)
project.execute_services(@push_data.dup, :tag_push_hooks)
- ProjectCacheWorker.perform_async(project.id, [], [:commit_count, :repository_size])
+ if update_statistics
+ ProjectCacheWorker.perform_async(project.id, [], [:commit_count, :repository_size])
+ end
true
end