Module: ActionCable::Server::Worker::ClearDatabaseConnections

Extended by:
ActiveSupport::Concern
Included in:
ActionCable::Server::Worker
Defined in:
lib/action_cable/server/worker/clear_database_connections.rb

Overview

Clear active connections between units of work so the long-running channel or connection processes do not hoard connections.

Instance Method Summary collapse

Instance Method Details

#with_database_connectionsObject


14
15
16
17
18
# File 'lib/action_cable/server/worker/clear_database_connections.rb', line 14

def with_database_connections
  yield
ensure
  ActiveRecord::Base.clear_active_connections!
end