if defined?(PhusionPassenger)
  PhusionPassenger.on_event(:starting_worker_process) do |forked|
    if forked
      Resque.redis.client.disconnect
      Resque.redis = Redis.new(:host => 'localhost', :port => 6379)
      Resque.redis.namespace = Site.first.resque_namespace rescue APP_CONFIG['orbit']
    else
      # We're in conservative spawning mode. We don't need to do anything.
    end
  end
end