Dashboard warning when clockwork doesn't seem to be running

This commit is contained in:
Neil Lalonde
2013-03-21 16:51:19 -04:00
parent 40962c84ca
commit 8cc7f3c20b
6 changed files with 78 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class AdminDashboardData
def as_json
@json ||= {
reports: REPORTS.map { |type| Report.find(type) },
problems: [rails_env_check, host_names_check, gc_checks].compact
problems: [rails_env_check, host_names_check, gc_checks, clockwork_check].compact
}.merge(
SiteSetting.version_checks? ? {version_check: DiscourseUpdates.check_version} : {}
)
@ -26,4 +26,8 @@ class AdminDashboardData
def gc_checks
I18n.t("dashboard.gc_warning") if ENV['RUBY_GC_MALLOC_LIMIT'].nil?
end
def clockwork_check
I18n.t('dashboard.clockwork_warning') unless Jobs::ClockworkHeartbeat.is_clockwork_running?
end
end