2013-03-11 08:33:20 -04:00
|
|
|
require "#{Rails.root}/lib/discourse_redis"
|
|
|
|
|
|
|
|
$redis = DiscourseRedis.new
|
|
|
|
|
2013-05-02 19:55:56 -04:00
|
|
|
if Rails.env.development? && ENV['DISCOURSE_FLUSH_REDIS']
|
2013-03-11 08:33:20 -04:00
|
|
|
puts "Flushing redis (development mode)"
|
|
|
|
$redis.flushall
|
|
|
|
end
|
|
|
|
|
|
|
|
if defined?(PhusionPassenger)
|
|
|
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
|
|
if forked
|
2014-03-27 22:48:14 -04:00
|
|
|
Discourse.after_fork
|
2013-03-11 08:33:20 -04:00
|
|
|
else
|
|
|
|
# We're in conservative spawning mode. We don't need to do anything.
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|