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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-09 21:08:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-09 21:08:16 +0300
commit4da595a071829d1046f921e402f3978eeca15d93 (patch)
treef792687f66b20dacfd5f48cae4ba42961bddddd7 /lib/gitlab/cluster
parentc87924a358cab4283e48f7c3ffd27b07320b9f62 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/cluster')
-rw-r--r--lib/gitlab/cluster/lifecycle_events.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/gitlab/cluster/lifecycle_events.rb b/lib/gitlab/cluster/lifecycle_events.rb
index 6159fb0a811..e423d1f17da 100644
--- a/lib/gitlab/cluster/lifecycle_events.rb
+++ b/lib/gitlab/cluster/lifecycle_events.rb
@@ -70,7 +70,7 @@ module Gitlab
# Hook registration methods (called from initializers)
#
def on_worker_start(&block)
- if in_clustered_environment?
+ if in_clustered_puma?
# Defer block execution
(@worker_start_hooks ||= []) << block
else
@@ -101,7 +101,7 @@ module Gitlab
end
def on_master_start(&block)
- if in_clustered_environment?
+ if in_clustered_puma?
on_before_fork(&block)
else
on_worker_start(&block)
@@ -158,21 +158,8 @@ module Gitlab
end
end
- def in_clustered_environment?
- # Sidekiq doesn't fork
- return false if Gitlab::Runtime.sidekiq?
-
- # Puma sometimes forks
- return true if in_clustered_puma?
-
- # Default assumption is that we don't fork
- false
- end
-
def in_clustered_puma?
- return false unless Gitlab::Runtime.puma?
-
- @puma_options && @puma_options[:workers] && @puma_options[:workers] > 0
+ Gitlab::Runtime.puma? && @puma_options && @puma_options[:workers] && @puma_options[:workers] > 0
end
end
end