Sidekiq: Passing 'connection' command to redis as is

Created on 11 Jan 2018  路  1Comment  路  Source: mperham/sidekiq

Ruby version: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
Sidekiq / Pro / Enterprise version(s): sidekiq (5.0.5) & redis-namespace (1.6.0)

Warning:

I get this warning whenever I check the Sidekiq Web UI:

Passing 'connection' command to redis as is; blind passthrough has been deprecated and will be removed in redis-namespace 2.0 (at /home/ubuntu/.rvm/gems/ruby-2.3.1/gems/sidekiq-5.0.5/lib/sidekiq/web/helpers.rb:151:in 'block in redis_connection')

Initializer:

require 'sidekiq'
require 'sidekiq/web'

Sidekiq::Web.use Rack::Auth::Basic do |username, password|
  username == (ENV['SIDEKIQ_UI_USERNAME'] || '') &&
    password == (ENV['SIDEKIQ_UI_PASSWORD'] || '')
end

Sidekiq.configure_server do |config|
  redis_url = ENV['REDIS_URL']
  raise "define environment variable REDIS_URL" if redis_url.nil? or redis_url.empty?
  config.redis = { url: "#{redis_url}", namespace: "rails_#{Rails.env}" }
end

Sidekiq.configure_client do |config|
  redis_url = ENV['REDIS_URL'] || 'http://localhost:6379'
  raise "define environment varialbe REDIS_URL(#{redis_url})" if redis_url.nil? or redis_url.empty?
  config.redis = { url: "#{redis_url}", namespace: "rails_#{Rails.env}" }
end

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paul-ylz picture paul-ylz  路  4Comments

smanolloff picture smanolloff  路  3Comments

bartimaeus picture bartimaeus  路  3Comments

HenleyChiu picture HenleyChiu  路  4Comments

aglushkov picture aglushkov  路  3Comments