mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
f3cc7360e0
After fork SiteSettings was not getting a new process id, causing site settings not to refresh properly in unicorn This code also centralizes the logic
18 lines
465 B
Ruby
18 lines
465 B
Ruby
require "#{Rails.root}/lib/discourse_redis"
|
|
|
|
$redis = DiscourseRedis.new
|
|
|
|
if Rails.env.development? && ENV['DISCOURSE_FLUSH_REDIS']
|
|
puts "Flushing redis (development mode)"
|
|
$redis.flushall
|
|
end
|
|
|
|
if defined?(PhusionPassenger)
|
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
if forked
|
|
Discourse.after_fork
|
|
else
|
|
# We're in conservative spawning mode. We don't need to do anything.
|
|
end
|
|
end
|
|
end
|