Commit c5bc495f authored by Jonne Haß's avatar Jonne Haß

move sidekiq configuration from initializer to sidekiq.yml

parent 4f8cf0fe
......@@ -11,31 +11,9 @@ if AppConfig.environment.single_process_mode? && Rails.env != "test"
require 'sidekiq/testing/inline'
end
def (Sidekiq::Logging).logger
defined?(@logger) ? @logger : (AppConfig.heroku? ? initialize_logger : initialize_logger(AppConfig.sidekiq_log))
end
Sidekiq.configure_server do |config|
config.redis = AppConfig.get_redis_options
config.options = config.options.merge({
concurrency: AppConfig.environment.sidekiq.concurrency.to_i,
queues: %w{
socket_webfinger
photos
http_service
dispatch
mail
delete_account
receive_local
receive
receive_salmon
http
maintenance
default
}
})
config.server_middleware do |chain|
chain.add SidekiqMiddlewares::CleanAndShortBacktraces
end
......@@ -46,7 +24,7 @@ Sidekiq.configure_server do |config|
ENV['DATABASE_URL'] = "#{database_url}?pool=#{AppConfig.environment.sidekiq.concurrency.get}"
ActiveRecord::Base.establish_connection
end
# Make sure each Sidekiq process has its own sequence of UUIDs
UUID.generator.next_sequence
end
......
require 'pathname'
require 'bundler/setup'
require 'configurate'
rails_root = File.expand_path('../../', __FILE__)
rails_env = ENV['RACK_ENV']
rails_env ||= ENV['RAILS_ENV']
rails_env ||= 'development'
rails_env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
require File.join(rails_root, 'lib', 'configuration_methods')
module Rails
def self.root
@__root ||= Pathname.new File.expand_path('../../', __FILE__)
end
end
require Rails.root.join 'lib', 'configuration_methods'
config_dir = File.join rails_root, 'config'
config_dir = Rails.root.join('config').to_s
AppConfig ||= Configurate::Settings.create do
......
<% require_relative 'config/load_config' %>
---
:verbose: false
:logfile: "<%= AppConfig.sidekiq_log unless AppConfig.heroku? %>"
:concurrency: <%= AppConfig.environment.sidekiq.concurrency.to_i %>
:queues:
- socket_webfinger
- photos
- http_service
- dispatch
- mail
- delete_account
- receive_local
- receive
- receive_salmon
- http
- maintenance
- default
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment