2017-05-03 23:18:13 +02:00
|
|
|
# frozen_string_literal: true
|
2016-03-25 02:50:48 +01:00
|
|
|
|
2018-04-10 16:08:28 +02:00
|
|
|
namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
|
2017-05-07 19:42:32 +02:00
|
|
|
redis_params = { url: ENV['REDIS_URL'] }
|
|
|
|
|
|
|
|
if namespace
|
2018-04-10 16:08:28 +02:00
|
|
|
redis_params[:namespace] = namespace
|
2017-05-07 19:42:32 +02:00
|
|
|
end
|
|
|
|
|
2016-03-25 02:50:48 +01:00
|
|
|
Sidekiq.configure_server do |config|
|
2017-05-07 19:42:32 +02:00
|
|
|
config.redis = redis_params
|
2018-02-24 19:16:11 +01:00
|
|
|
|
|
|
|
config.server_middleware do |chain|
|
|
|
|
chain.add SidekiqErrorHandler
|
|
|
|
end
|
2016-03-25 02:50:48 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
Sidekiq.configure_client do |config|
|
2017-05-07 19:42:32 +02:00
|
|
|
config.redis = redis_params
|
2016-03-25 02:50:48 +01:00
|
|
|
end
|
2018-04-10 16:08:28 +02:00
|
|
|
|
2018-10-04 17:38:04 +02:00
|
|
|
Sidekiq::Logging.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
|