Sha256: 0fb8aa86fa7d59982ec4e09724cd89a58a38fa898fd17419e6d053b5aa3ba2f8
Contents?: true
Size: 1.53 KB
Versions: 79
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 => "#{ZuoraConnect::Telegraf.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 => "#{ZuoraConnect::Telegraf.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 => "#{ZuoraConnect::Telegraf.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
79 entries across 79 versions & 1 rubygems