diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb new file mode 100644 index 0000000..c77dfe9 --- /dev/null +++ b/config/initializers/redis.rb @@ -0,0 +1,11 @@ +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 \ No newline at end of file