Adding Sidekiq for background processing (firstly just of mailers)
This commit is contained in:
@ -28,6 +28,8 @@ module Mastodon
|
||||
config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
|
||||
config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
|
||||
|
||||
config.active_job.queue_adapter = :sidekiq
|
||||
|
||||
config.to_prepare do
|
||||
Doorkeeper::ApplicationsController.layout 'dashboard'
|
||||
Doorkeeper::AuthorizedApplicationsController.layout 'dashboard'
|
||||
|
11
config/initializers/sidekiq.rb
Normal file
11
config/initializers/sidekiq.rb
Normal file
@ -0,0 +1,11 @@
|
||||
redis_conn = proc {
|
||||
$redis.dup
|
||||
}
|
||||
|
||||
Sidekiq.configure_server do |config|
|
||||
config.redis = ConnectionPool.new(size: 5, &redis_conn)
|
||||
end
|
||||
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = ConnectionPool.new(size: 25, &redis_conn)
|
||||
end
|
@ -1,4 +1,10 @@
|
||||
require 'sidekiq/web'
|
||||
|
||||
Rails.application.routes.draw do
|
||||
authenticate :user do
|
||||
mount Sidekiq::Web => '/sidekiq'
|
||||
end
|
||||
|
||||
use_doorkeeper do
|
||||
controllers applications: 'oauth/applications'
|
||||
end
|
||||
|
Reference in New Issue
Block a user