diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 2 | ||||
-rw-r--r-- | config/initializers/sidekiq.rb | 11 | ||||
-rw-r--r-- | config/routes.rb | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb index 9d8d6022d..1fbd8f7f6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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' diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb new file mode 100644 index 000000000..83958d700 --- /dev/null +++ b/config/initializers/sidekiq.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index f595438b7..0dde9f111 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 |