Skip to content

Commit

Permalink
Skip initializing clusters if is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
gussan committed Jan 19, 2015
1 parent e39f563 commit 2c7599c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/active_record/turntable/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ class Railtie < Rails::Railtie
# initialize
initializer "turntable.initialize_clusters" do
ActiveSupport.on_load(:active_record) do
ActiveRecord::Turntable::Config.load!
if File.exist?(ActiveRecord::Base.turntable_config_file)
ActiveRecord::Turntable::Config.load!
else
warn("[activerecord-turntable] config/turntable.yml is not found. skipped initliazing cluster.")
end
end
end

Expand Down

0 comments on commit 2c7599c

Please sign in to comment.