diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-03-30 17:26:30 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-04-05 15:43:08 +0300 |
commit | 8eb350663e0dbee481e5a5f2a785dbbf365e18cc (patch) | |
tree | b62f86271fdd681b54462d0e2cb4c9e872167719 /config/initializers/8_gitaly.rb | |
parent | a40e357f27ddcefa9ef70be84c7e7ee0f3b15e02 (diff) |
Deal with Rails autoload instance variable resets
Rails auto-load (a development feature) can end up resetting instance
variables on classes. This breaks Gitlab::GitalyClient, which uses
instance variables to keep global hashes to look up channels and
addresses. This change adds code that regenerates the hashes if they
suddenly become nil.
Diffstat (limited to 'config/initializers/8_gitaly.rb')
-rw-r--r-- | config/initializers/8_gitaly.rb | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/config/initializers/8_gitaly.rb b/config/initializers/8_gitaly.rb index c7f27c78535..42ec7240b0f 100644 --- a/config/initializers/8_gitaly.rb +++ b/config/initializers/8_gitaly.rb @@ -2,17 +2,5 @@ require 'uri' # Make sure we initialize our Gitaly channels before Sidekiq starts multi-threaded execution. if Gitlab.config.gitaly.enabled || Rails.env.test? - Gitlab.config.repositories.storages.each do |name, params| - address = params['gitaly_address'] - - unless address.present? - raise "storage #{name.inspect} is missing a gitaly_address" - end - - unless URI(address).scheme.in?(%w(tcp unix)) - raise "Unsupported Gitaly address: #{address.inspect}" - end - - Gitlab::GitalyClient.configure_channel(name, address) - end + Gitlab::GitalyClient.configure_channels end |