redis_config = YAML.load_file(File.join(Rails.root, "config", "redis.yml"))

redis_config_for_sidekiq = {
  :url => "redis://#{redis_config['host']}:#{redis_config['port']}/0",
  :namespace => "transition"
}

Sidekiq.configure_server do |config|
  config.redis = redis_config_for_sidekiq
end

Sidekiq.configure_client do |config|
  config.redis = redis_config_for_sidekiq
end

Fix Sidekiq's redis connection in production
Fix Sidekiq's redis connection in production

We were relying on Sidekiq's default (localhost) redis connection, which works
in development but not in our production-like environments.

config/redis.yml is already overwritten on deploy to configure it correctly for
distributed locking, so let's reuse that.
