2015-07-06 15:51:15 -04:00
|
|
|
# Easiest way to run Sidekiq::Web.
|
|
|
|
# Run with "bundle exec rackup simple.ru"
|
|
|
|
|
2021-02-12 17:50:51 -05:00
|
|
|
require 'sidekiq/web'
|
2015-07-06 15:51:15 -04:00
|
|
|
|
|
|
|
# A Web process always runs as client, no need to configure server
|
|
|
|
Sidekiq.configure_client do |config|
|
2017-11-02 12:03:37 -04:00
|
|
|
config.redis = { url: 'redis://localhost:6379/0', size: 1 }
|
2015-07-06 15:51:15 -04:00
|
|
|
end
|
|
|
|
|
2015-11-23 12:39:14 -05:00
|
|
|
Sidekiq::Client.push('class' => "HardWorker", 'args' => [])
|
|
|
|
|
2021-02-12 17:50:51 -05:00
|
|
|
# In a multi-process deployment, all Web UI instances should share
|
|
|
|
# this secret key so they can all decode the encrypted browser cookies
|
|
|
|
# and provide a working session.
|
|
|
|
# Rails does this in /config/initializers/secret_token.rb
|
|
|
|
secret_key = SecureRandom.hex(32)
|
|
|
|
use Rack::Session::Cookie, secret: secret_key, same_site: true, max_age: 86400
|
2015-07-06 15:51:15 -04:00
|
|
|
run Sidekiq::Web
|