mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: disable async logging in development on broken Ruby
Ruby 2.5.3 has an upatched issue that crashes unicorn after fork: https://bugs.ruby-lang.org/issues/14634 This will be patched in 2.5.4 however for now just warn people dev is slower and disable async logging on the older rubies
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
if Rails.env.development? && RUBY_VERSION.match?(/^2\.5\.[23]/)
|
||||
STDERR.puts "WARNING: Discourse development environment runs slower on Ruby 2.5.3 or below"
|
||||
STDERR.puts "We recommend you upgrade to Ruby 2.6.1 for the optimal development performance"
|
||||
|
||||
# we have to used to older and slower version of the logger cause the new one exposes a Ruby bug in
|
||||
# the Queue class which causes segmentation faults
|
||||
Logster::Scheduler.disable
|
||||
end
|
||||
|
||||
if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1"
|
||||
console = ActiveSupport::Logger.new(STDOUT)
|
||||
original_logger = Rails.logger.chained.first
|
||||
|
||||
Reference in New Issue
Block a user