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