about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-03-26 18:22:54 +0100
committerGitHub <noreply@github.com>2021-03-26 18:22:54 +0100
commit59f94593d059239c28ab5fb8e2a0c23ce2590254 (patch)
tree534b643666e1a934f2df289185b28a2cd3ca9a0f
parentdd1eb9918ad54fec3a524a53e339ee6c8be9de11 (diff)
Add warning in admin dashboard if some required queues are not handled (#15954)
-rw-r--r--app/controllers/admin/dashboard_controller.rb6
-rw-r--r--config/locales/en.yml1
2 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb
index 7c2951acb..24162ec63 100644
--- a/app/controllers/admin/dashboard_controller.rb
+++ b/app/controllers/admin/dashboard_controller.rb
@@ -3,7 +3,13 @@ require 'sidekiq/api'
 
 module Admin
   class DashboardController < BaseController
+    SIDEKIQ_QUEUES = %w(default push mailers pull scheduler).freeze
+
     def index
+      missing_queues = Sidekiq::ProcessSet.new.reduce(SIDEKIQ_QUEUES) { |queues, process| queues - process['queues'] }
+
+      flash.now[:alert] = I18n.t('admin.dashboard.misconfigured_sidekiq_alert', queues: missing_queues.join(', ')) unless missing_queues.empty?
+
       @users_count           = User.count
       @pending_users_count   = User.pending.count
       @registrations_week    = Redis.current.get("activity:accounts:local:#{current_week}") || 0
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 14f1a08e4..b907d3882 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -367,6 +367,7 @@ en:
       feature_timeline_preview: Timeline preview
       features: Features
       hidden_service: Federation with hidden services
+      misconfigured_sidekiq_alert: 'No Sidekiq process seems to be handling the following queues: %{queues}. Please review your Sidekiq configuration.'
       open_reports: open reports
       pending_tags: hashtags waiting for review
       pending_users: users waiting for review