Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-08-14 17:38:28 +0300
committerNick Thomas <nick@gitlab.com>2019-08-14 17:38:28 +0300
commit3cd40c4a807fef5f99c60853ab81f8729405e315 (patch)
tree2d644a6b3d4a2a57f4d94117b15b3a31cae1c97d /app/models
parent03c8bb125573d3910689d10b979a6aa59b680ff6 (diff)
parent4e2bb4e5e7df1273a4d2fdd370b6c17a27c394d8 (diff)
Merge branch 'sh-optimize-commit-deltas-post-receive' into 'master'
Reduce Gitaly calls in PostReceive Closes #65878 See merge request gitlab-org/gitlab-ce!31741
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index a6e43efa1f3..0c57ed3e43a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1230,6 +1230,14 @@ class Project < ApplicationRecord
end
end
+ def has_active_hooks?(hooks_scope = :push_hooks)
+ hooks.hooks_for(hooks_scope).any? || SystemHook.hooks_for(hooks_scope).any?
+ end
+
+ def has_active_services?(hooks_scope = :push_hooks)
+ services.public_send(hooks_scope).any? # rubocop:disable GitlabSecurity/PublicSend
+ end
+
def valid_repo?
repository.exists?
rescue