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>2020-02-06 21:08:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 21:08:54 +0300
commit0d6fa033121a9bef708b8f2de186c4034c61d4a3 (patch)
tree851d65a09efbffa114c9a273e590d55cfb1436ab /lib/gitlab/runtime.rb
parent0eb3d2f799ce4f4de87fb9fc6fd98e592323bc89 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/runtime.rb')
-rw-r--r--lib/gitlab/runtime.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/gitlab/runtime.rb b/lib/gitlab/runtime.rb
index 64ab020a30e..182c13980e6 100644
--- a/lib/gitlab/runtime.rb
+++ b/lib/gitlab/runtime.rb
@@ -8,15 +8,19 @@ module Gitlab
AmbiguousProcessError = Class.new(IdentificationError)
UnknownProcessError = Class.new(IdentificationError)
+ AVAILABLE_RUNTIMES = [
+ :console,
+ :geo_log_cursor,
+ :puma,
+ :rake,
+ :sidekiq,
+ :test_suite,
+ :unicorn
+ ].freeze
+
class << self
def identify
- matches = []
- matches << :puma if puma?
- matches << :unicorn if unicorn?
- matches << :console if console?
- matches << :sidekiq if sidekiq?
- matches << :rake if rake?
- matches << :test_suite if test_suite?
+ matches = AVAILABLE_RUNTIMES.select { |runtime| public_send("#{runtime}?") } # rubocop:disable GitlabSecurity/PublicSend
if matches.one?
matches.first
@@ -56,6 +60,10 @@ module Gitlab
!!defined?(::Rails::Console)
end
+ def geo_log_cursor?
+ !!defined?(::GeoLogCursorOptionParser)
+ end
+
def web_server?
puma? || unicorn?
end