Sha256: d4b7e57a746bbf3e3418f43d86d2cda83587472226c96b1003d53db8ba196d56
Contents?: true
Size: 1.53 KB
Versions: 56
Compression:
Stored size: 1.53 KB
Contents
redis_url = ENV["REDIS_URL"].present? ? ENV["REDIS_URL"] : defined?(Rails.application.secrets.redis) ? Rails.application.secrets.redis : 'redis://localhost:6379/1' resque_url = ENV["RESQUE_URL"].present? ? ENV["RESQUE_URL"] : defined?(Rails.application.secrets.resque) ? Rails.application.secrets.resque : 'redis://localhost:6379/1' flash_url = ENV["FLASH_URL"].present? ? ENV["FLASH_URL"] : defined?(Rails.application.secrets.flash) ? Rails.application.secrets.flash : nil browser_urls = {} class RedisFlash def self.current @current ||= Redis.new() end def self.current=(redis) @current = redis end end if defined?(Redis.current) Redis.current = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'Redis')}", :url => redis_url, :timeout => 6, :reconnect_attempts => 2) browser_urls['Redis'] = { "url" => redis_url } if defined?(Resque.redis) if resque_url != redis_url Resque.redis = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'Resque')}", :url => resque_url, :timeout => 6, :reconnect_attempts => 2) browser_urls['Resque'] = { "url" => resque_url } else Resque.redis = Redis.current end end if defined?(flash_url.present?) RedisFlash.current = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'Flash')}", :url => flash_url, :timeout => 6, :reconnect_attempts => 2) browser_urls['Flash'] = { "url" => flash_url } end end if defined?(RedisBrowser) RedisBrowser.configure("connections" => browser_urls) end
Version data entries
56 entries across 56 versions & 1 rubygems