Fix Resque "Internal Server Error" issue in pushion passenger forked environment
This commit is contained in:
parent
ee6dcf238f
commit
095157c0ae
|
@ -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
|
Reference in New Issue