2013-03-05 13:14:29 -08:00
|
|
|
# Sometimes the Resque workers have trouble maintaining their connections to
|
|
|
|
# Redis and to the database. It's not entirely clear when and why (though the
|
|
|
|
# internet suggests that it has to do with lying dormant for too long), but
|
|
|
|
# this fix ensures that Redis and the database are available at the start of
|
|
|
|
# every job.
|
2013-01-28 01:55:36 -08:00
|
|
|
Resque.after_fork do
|
|
|
|
Resque.redis.client.reconnect
|
2013-03-05 13:14:29 -08:00
|
|
|
ActiveRecord::Base.connection_handler.verify_active_connections!
|
2013-01-28 01:55:36 -08:00
|
|
|
end
|