Ho un'app che accetta i caricamenti di immagini. È un'app per rails 3 su heroku che usa Unicorn. Occasionalmente ricevo le eccezioni unicorn::clientshutdown
e non so davvero cosa le causa o come gestirle. Cosa dovrei fare?Cosa posso fare su unicorn: errori di clientshutdown sulla mia app heroku rails?
Questo è il mio unicorn.rb
di file: arrivi
before_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
Rails.logger.info('Disconnected from ActiveRecord')
end
# If you are using Redis but not Resque, change this
if defined?(Resque)
Resque.redis.quit
Rails.logger.info('Disconnected from Redis')
end
end
after_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
Rails.logger.info('Connected to ActiveRecord')
end
# If you are using Redis but not Resque, change this
if defined?(Resque)
Resque.redis = ENV['REDIS_URI']
Rails.logger.info('Connected to Redis')
end
end
Vuol il file di log unicorno scoprirai qualcosa? –