mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 17:01:09 +08:00
DEV: Revert rails 7.1 upgrade (#27522)
* Revert "FIX: Set `override_level` on Logster loggers (#27519)" This reverts commit c1b0488c547bca935de51cfbb86bbc528e9ab2e5. * Revert "DEV: Make parameters optional to all FakeLogger methods" This reverts commit 3318dad7b4e3365854319bb55301cf667a2c28d0. * Revert "FIX: Remove references to `Rails.logger.chained`" This reverts commit f595d599dd361b7fb39fb3c82cbc11d19d518c19. * Revert "DEV: Upgrade Rails to 7.1" This reverts commit 081b00391e47a7f9bc44b9fe8ce88ac97d728352.
This commit is contained in:
@ -954,7 +954,14 @@ module Discourse
|
||||
def self.warn(message, env = nil)
|
||||
append = env ? (+" ") << env.map { |k, v| "#{k}: #{v}" }.join(" ") : ""
|
||||
|
||||
loggers = Rails.logger.broadcasts
|
||||
if !(Logster::Logger === Rails.logger)
|
||||
Rails.logger.warn("#{message}#{append}")
|
||||
return
|
||||
end
|
||||
|
||||
loggers = [Rails.logger]
|
||||
loggers.concat(Rails.logger.chained) if Rails.logger.chained
|
||||
|
||||
logster_env = env
|
||||
|
||||
if old_env = Thread.current[Logster::Logger::LOGSTER_ENV]
|
||||
@ -1109,7 +1116,16 @@ module Discourse
|
||||
end
|
||||
end
|
||||
|
||||
schema_cache = ActiveRecord::Base.connection.schema_cache
|
||||
|
||||
RailsMultisite::ConnectionManagement.safe_each_connection do
|
||||
# load up schema cache for all multisite assuming all dbs have
|
||||
# an identical schema
|
||||
dup_cache = schema_cache.dup
|
||||
# this line is not really needed, but just in case the
|
||||
# underlying implementation changes lets give it a shot
|
||||
dup_cache.connection = nil
|
||||
ActiveRecord::Base.connection.schema_cache = dup_cache
|
||||
I18n.t(:posts)
|
||||
|
||||
# this will force Cppjieba to preload if any site has it
|
||||
|
Reference in New Issue
Block a user