diff options
| author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-03 12:16:45 +0200 |
|---|---|---|
| committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-04 15:38:49 +0200 |
| commit | 3899d07f9eb5ffa2369195c800be18e297f67613 (patch) | |
| tree | 5a8e252d127878f4057ec884f3407874b86645d4 /lib | |
| parent | 0fa94a0dddfc38635abf49a38dbadc9b9ead4d7a (diff) | |
| download | gitlab-ce-3899d07f9eb5ffa2369195c800be18e297f67613.tar.gz | |
Move hostname to Gitlab::Environment
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/environment.rb | 7 | ||||
| -rw-r--r-- | lib/gitlab/git/storage/circuit_breaker.rb | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/environment.rb b/lib/gitlab/environment.rb new file mode 100644 index 00000000000..5e0dd6e7859 --- /dev/null +++ b/lib/gitlab/environment.rb @@ -0,0 +1,7 @@ +module Gitlab + module Environment + def self.hostname + @hostname ||= ENV['HOSTNAME'] || Socket.gethostname + end + end +end diff --git a/lib/gitlab/git/storage/circuit_breaker.rb b/lib/gitlab/git/storage/circuit_breaker.rb index c722771e0d5..7b040a05c42 100644 --- a/lib/gitlab/git/storage/circuit_breaker.rb +++ b/lib/gitlab/git/storage/circuit_breaker.rb @@ -31,7 +31,7 @@ module Gitlab cached_circuitbreakers[storage] end - def initialize(storage, hostname = Gitlab.config.gitlab.hostname) + def initialize(storage, hostname = Gitlab::Environment.hostname) @storage = storage @hostname = hostname |
