Created
July 3, 2013 15:43
-
-
Save shamil614/5919553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.staging? || Rails.env.production? | |
begin | |
redis_config = YAML.load_file(Rails.root + 'config/redis.yml')[Rails.env] | |
Sidekiq.configure_server do |config| | |
config.redis = { :url => "redis://#{redis_config['host']}:#{redis_config['port']}", :namespace => 'nin' } | |
end | |
# When in Unicorn, this block needs to go in unicorn's `after_fork` callback: | |
Sidekiq.configure_client do |config| | |
config.redis = { :url => "redis://#{redis_config['host']}:#{redis_config['port']}", :namespace => 'nin' } | |
end | |
rescue | |
Rails.logger.error "Unable to start sidekiq." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment