Skip to content

Commit

Permalink
support for remote redis host via env
Browse files Browse the repository at this point in the history
to support redis-cloud on heroku
  • Loading branch information
macool committed Apr 27, 2014
1 parent 015445f commit 779b18b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
redis_host = ENV["REDIS_HOST"] || "redis://localhost:6379"
base_conf = { url: redis_host, namespace: "#{Rails.application.class.parent_name}_#{Rails.env}" }

Sidekiq.configure_server do |config|
config.redis = { :url => 'redis://localhost:6379', :namespace => Rails.application.class.parent_name }
config.redis = base_conf
end

Sidekiq.configure_client do |config|
config.redis = { :url => 'redis://localhost:6379', :namespace => Rails.application.class.parent_name }
config.redis = base_conf
end

0 comments on commit 779b18b

Please sign in to comment.