Feature:Notify Devs when Sidekiq is Not Running in Development (#10541)
This commit is contained in:
parent
9e8ce4569e
commit
ea969748e9
2 changed files with 17 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ class ApplicationController < ActionController::Base
|
|||
include CachingHeaders
|
||||
include ImageUploads
|
||||
include VerifySetupCompleted
|
||||
include DevelopmentDependencyChecks if Rails.env.development?
|
||||
include Devise::Controllers::Rememberable
|
||||
|
||||
rescue_from ActionView::MissingTemplate, with: :routing_error
|
||||
|
|
|
|||
16
app/controllers/concerns/development_dependency_checks.rb
Normal file
16
app/controllers/concerns/development_dependency_checks.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
module DevelopmentDependencyChecks
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :verify_sidekiq_running, only: %i[index show], if: proc { Rails.env.development? }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def verify_sidekiq_running
|
||||
return if Sidekiq::ProcessSet.new.size.positive?
|
||||
|
||||
flash[:global_notice] = "Sidekiq is not running and is needed for the app to function properly. \
|
||||
Use bin/startup to start the application properly.".html_safe
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue