Show a warning on admin dashboard if running on an older patch level of ruby 2.0

This commit is contained in:
Neil Lalonde 2013-10-24 18:22:47 -04:00
parent 017efdece5
commit d149066ac6
2 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class AdminDashboardData
def problems
[ rails_env_check,
ruby_version_check,
host_names_check,
gc_checks,
sidekiq_check || queue_size_check,
@ -161,6 +162,10 @@ class AdminDashboardData
I18n.t('dashboard.notification_email_warning') if SiteSetting.notification_email.blank?
end
def ruby_version_check
I18n.t('dashboard.ruby_version_warning') if RUBY_VERSION == '2.0.0' and RUBY_PATCHLEVEL < 247
end
# TODO: generalize this method of putting i18n keys with expiry in redis
# that should be reported on the admin dashboard:

View File

@ -418,6 +418,7 @@ en:
dashboard:
rails_env_warning: "Your server is running in %{env} mode."
ruby_version_warning: "You are running a version of Ruby 2.0.0 that is known to have problems. Upgrade to patch level 247 or later."
host_names_warning: "Your config/database.yml file is using the default localhost hostname. Update it to use your site's hostname."
gc_warning: 'Your server is using default ruby garbage collection parameters, which will not give you the best performance. Read this topic on performance tuning: <a href="http://meta.discourse.org/t/tuning-ruby-and-rails-for-discourse/4126" target="_blank">Tuning Ruby and Rails for Discourse</a>.'
sidekiq_warning: 'Sidekiq is not running. Many tasks, like sending emails, are executed asynchronously by sidekiq. Please ensure at least one sidekiq process is running. <a href="https://github.com/mperham/sidekiq" target="_blank">Learn about Sidekiq here</a>.'