Sha256: 0432c086d12d992f064b53dee03d58272f9345807e36489452c95002e4bfd220
Contents?: true
Size: 1.03 KB
Versions: 8
Compression:
Stored size: 1.03 KB
Contents
if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| # We're in smart spawning mode. if forked # Re-establish redis connection require 'redis' config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access # The important two lines $redis.client.disconnect if $redis $redis = begin Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil end Resque.redis = $redis Resque.redis.namespace = "#{CurationConcerns.config.redis_namespace}:#{Rails.env}" Resque.redis.client.reconnect if Resque.redis end end else config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'redis.yml'))).result)[Rails.env].with_indifferent_access $redis = begin Redis.new(host: config[:host], port: config[:port], thread_safe: true) rescue nil end end
Version data entries
8 entries across 8 versions & 1 rubygems