DEV: improve on rake db:create

Followup on 3af00a65 which broke build
This commit is contained in:
Sam Saffron 2019-06-14 15:05:29 +10:00
parent 41abebcbce
commit a01488ae67
2 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,9 @@
# frozen_string_literal: true
if GlobalSetting.skip_redis?
Rails.logger = Rails.logger.chained.first
if Rails.logger.respond_to? :chained
Rails.logger = Rails.logger.chained.first
end
return
end
@ -142,6 +144,8 @@ RailsMultisite::ConnectionManagement.each_connection do
end
if Rails.configuration.multisite
chained = Rails.logger.chained
chained && chained.first.formatter = RailsMultisite::Formatter.new
if Rails.logger.respond_to? :chained
chained = Rails.logger.chained
chained && chained.first.formatter = RailsMultisite::Formatter.new
end
end

View File

@ -26,9 +26,9 @@ task 'db:force_skip_persist' do
GlobalSetting.skip_redis = true
end
task 'db:create' do |_, args|
if MultisiteTestHelpers.load_multisite?
system("RAILS_DB=discourse_test_multisite rake db:create")
task 'db:create' => [:load_config] do |_, args|
if !ENV['RAILS_ENV']
system("RAILS_ENV=test RAILS_DB=discourse_test_multisite rake db:create")
end
end