activejob-resque-disconnect

If you're using ActiveRecord with Resque, a new database connection will get opened for each worker process. When the worker completes, this connection is left open by default, which is pretty bad. This adapter closes the connection when the job has_rdoc finished executing.


License
MIT
Install
gem install activejob-resque-disconnect -v 0.1.0

Documentation

ActiveJob::QueueAdapters::ResqueDisconnectAdapter

ActiveJob adapter for Resque which disconnects when the worker has finished.

By default the connection will be left open until the database times it out, which eats up database connections for no good reason.

require 'active_job/queue_adapters/resque_disconnect_adapter'

MyApp::Application.configure do
  config.active_job.queue_adapter = ActiveJob::QueueAdapters::ResqueDisconnectAdapter
end