闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
506 B

  1. # frozen_string_literal: true
  2. namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
  3. redis_params = { url: ENV['REDIS_URL'] }
  4. if namespace
  5. redis_params[:namespace] = namespace
  6. end
  7. Sidekiq.configure_server do |config|
  8. config.redis = redis_params
  9. config.server_middleware do |chain|
  10. chain.add SidekiqErrorHandler
  11. end
  12. end
  13. Sidekiq.configure_client do |config|
  14. config.redis = redis_params
  15. end
  16. Sidekiq::Logging.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)