summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-10 12:32:05 +0000
committerStan Hu <stanhu@gmail.com>2016-06-10 12:32:05 +0000
commit9734b8bb563dae3a203f8e0c3bc6d80fd9cad400 (patch)
treeb2336b7727b025595c8a7daef59ff3c277fa49ce
parentcfc99bbd1390bc548a703fdc7857c7db5b0e7c13 (diff)
parent72647eda3121566c92941a1e98088c31a77cb9a5 (diff)
downloadgitlab-ce-9734b8bb563dae3a203f8e0c3bc6d80fd9cad400.tar.gz
Merge branch 'fix-already-initialized-constant' into 'master'
Don't require Gitlab::Redis in mail_room.yml if it's already defined ## What does this MR do? Avoid requiring `lib/gitlab/redis.rb` if `Gitlab::Redis` is already defined. ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? Because otherwise you get `already initialized constant Gitlab::Redis::XXX`, e.g.: ``` › bin/rspec spec/config/mail_room_spec.rb Running via Spring preloader in process 24658 /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:3: warning: already initialized constant Gitlab::Redis::CACHE_NAMESPACE /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:3: warning: previous definition of CACHE_NAMESPACE was here /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:4: warning: already initialized constant Gitlab::Redis::SESSION_NAMESPACE /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:4: warning: previous definition of SESSION_NAMESPACE was here /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:5: warning: already initialized constant Gitlab::Redis::SIDEKIQ_NAMESPACE /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:5: warning: previous definition of SIDEKIQ_NAMESPACE was here /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:12: warning: already initialized constant Gitlab::Redis::URL_MUTEX /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:12: warning: previous definition of URL_MUTEX was here /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:13: warning: already initialized constant Gitlab::Redis::POOL_MUTEX /Users/remy/Code/GitLab/gdk/gitlab/lib/gitlab/redis.rb:13: warning: previous definition of POOL_MUTEX was here 2/2 |================================================= 100 =================================================>| Time: 00:00:00 Finished in 0.38505 seconds (files took 0.48292 seconds to load) 2 examples, 0 failures ``` ## What are the relevant issue numbers? None! ## Does this MR meet the acceptance criteria? - [x] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~ Not needed. - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ Not needed. - [x] ~~API support added.~~ Not needed. - [x] ~~Tests.~~ Not needed. - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4586
-rw-r--r--config/mail_room.yml2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/mail_room.yml b/config/mail_room.yml
index 761a32adb9e..7cab24b295e 100644
--- a/config/mail_room.yml
+++ b/config/mail_room.yml
@@ -2,7 +2,7 @@
<%
require "yaml"
require "json"
-require_relative "lib/gitlab/redis"
+require_relative "lib/gitlab/redis" unless defined?(Gitlab::Redis)
rails_env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"