about summary refs log tree commit diff
path: root/app/controllers/admin/dashboard_controller.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-03-31 10:34:29 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-03-31 10:34:29 +0200
commit15efa32cca5c2d7dfc32b101a38081add1b3af40 (patch)
tree8b75038d0c2d6a6bc4f8b38de6a13ddc9bedbff0 /app/controllers/admin/dashboard_controller.rb
parenta2a85d5ae03282c6f9cbf452b9b8f7d948a9f380 (diff)
parentf5bcc6bc65dee332542195e807ecff446cea0ae4 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/controllers/admin/dashboard_controller.rb')
-rw-r--r--app/controllers/admin/dashboard_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb
index 4116f99f4..e87dd076f 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