mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Upgrade Rails to version 7.2
This commit is contained in:
committed by
Loïc Guitaut
parent
f4d0a77d5f
commit
d6bec460a8
@@ -2,10 +2,7 @@
|
||||
|
||||
# Multisite freedom patch defines RailsMultisite::DiscoursePatches.config which is used by 200-first_middlewares.rb
|
||||
# Therefore it can not be postponed with .to_prepare
|
||||
RUN_WITHOUT_PREPARE = [
|
||||
"#{Rails.root}/lib/freedom_patches/rails_multisite.rb",
|
||||
"#{Rails.root}/lib/freedom_patches/rails_rack_logger_from_rails_7_2.rb",
|
||||
]
|
||||
RUN_WITHOUT_PREPARE = ["#{Rails.root}/lib/freedom_patches/rails_multisite.rb"]
|
||||
RUN_WITHOUT_PREPARE.each { |path| require(path) }
|
||||
|
||||
Rails.application.reloader.to_prepare do
|
||||
|
||||
@@ -44,7 +44,7 @@ if defined?(RailsFailover::ActiveRecord)
|
||||
|
||||
# Test connection to the master, and trigger master failover if needed
|
||||
ActiveRecord::Base.connected_to(role: ActiveRecord.writing_role) do
|
||||
ActiveRecord::Base.connection.active?
|
||||
ActiveRecord::Base.connection.connect!.active?
|
||||
rescue PG::ConnectionBad, PG::UnableToSend, PG::ServerError
|
||||
RailsFailover::ActiveRecord.verify_primary(ActiveRecord.writing_role)
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# On initialize, reset flags cache
|
||||
Rails.application.config.to_prepare do
|
||||
if Discourse.cache.is_a?(Cache) &&
|
||||
!ActiveRecord::Base.connection.migration_context.needs_migration?
|
||||
!ActiveRecord::Base.connection_pool.migration_context.needs_migration?
|
||||
Flag.reset_flag_settings!
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user