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
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-14 22:45:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-14 22:45:29 +0300
commitb9fe665d2539f53fb86771383e18f9045db52414 (patch)
tree7e55fcd9b4dc27f3cb13651ce1c03146c592e483 /lib
parentdd22031c62b54a03909b7be829f85032e556a031 (diff)
Add latest changes from gitlab-org/gitlab@14-8-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/cleanup/orphan_job_artifact_files.rb3
-rw-r--r--lib/gitlab/cluster/lifecycle_events.rb19
2 files changed, 6 insertions, 16 deletions
diff --git a/lib/gitlab/cleanup/orphan_job_artifact_files.rb b/lib/gitlab/cleanup/orphan_job_artifact_files.rb
index 05dfdcd4486..90123b9d000 100644
--- a/lib/gitlab/cleanup/orphan_job_artifact_files.rb
+++ b/lib/gitlab/cleanup/orphan_job_artifact_files.rb
@@ -99,6 +99,9 @@ module Gitlab
# ^--+--+- components of hashed storage project path
cmd += %w[-mindepth 6 -maxdepth 6]
+ # Intentionally exclude pipeline artifacts which match the same path
+ cmd += %w[-not -path */pipelines/*]
+
# Artifact directories are named on their ID
cmd += %w[-type d]
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