# Gemfile
# Sidekiq
gem 'sidekiq'
#config/application.rb
config.active_job.queue_adapter = :sidekiq
https://edgeguides.rubyonrails.org/active_job_basics.html
Monitoring · mperham/sidekiq Wiki
Monitoring - mperham/sidekiq Wiki
Rails API Application Session Configuration
To access the Web UI from a Rails API application, you may need to configure sessions for Sidekiq specifically.
Update config/application.rb to configure the cookie session store:
config.session_store :cookie_store, key: '_interslice_session'
Update config/routes.rb to set up session middleware for Sidekiq::Web prior to calling mount Sidekiq::Web:
require 'sidekiq/web'
# Configure Sidekiq-specific session middleware
Sidekiq::Web.use ActionDispatch::Cookies
Sidekiq::Web.use Rails.application.config.session_store, Rails.application.config.session_options
Myapp::Application.routes.draw do
mount Sidekiq::Web => "/sidekiq"
# ...
end
# config/routes.rb
require 'sidekiq/web'
Rails.application.routes.draw do
mount Sidekiq::Web => "/sidekiq"
end
redis-cli flushall
rails generate sidekiq:job hard