add back the warning based on Sidekiq queue size, but only when the queue size is 100k or more

This commit is contained in:
Neil Lalonde
2015-08-06 16:46:49 -04:00
parent 75ee523a83
commit a4a14e6d5a
2 changed files with 7 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class AdminDashboardData
ruby_version_check,
host_names_check,
gc_checks,
sidekiq_check,
sidekiq_check || queue_size_check,
ram_check,
google_oauth2_config_check,
facebook_config_check,
@ -109,6 +109,11 @@ class AdminDashboardData
I18n.t('dashboard.sidekiq_warning') if Jobs.queued > 0 and (last_job_performed_at.nil? or last_job_performed_at < 2.minutes.ago)
end
def queue_size_check
queue_size = Jobs.queued
I18n.t('dashboard.queue_size_warning', queue_size: queue_size) unless queue_size < 100_000
end
def ram_check
I18n.t('dashboard.memory_warning') if MemInfo.new.mem_total and MemInfo.new.mem_total < 1_000_000
end