class Delayed::Backend::ActiveRecord::ReleaseConnection

Plugin responsible for releasing ActiveRecord connections. Connection (mapped to the current worker thread) gets cleared as the worker finishes a 'work' iteration and goes to sleep. Expected to be compatibile with AR versions 4.x/5.x.

`Delayed::Worker.plugins << Delayed::Backend::ActiveRecord::ReleaseConnection`

@note Should be the last one in the plugin list. @note `require 'delayed/active_record/release_connection_plugin.rb'`

Public Class Methods

call(_) click to toggle source
# File lib/delayed/backend/active_record/release_connection.rb, line 17
def self.call(_)
  ::ActiveRecord::Base.clear_active_connections!
  # ~ connection_pool_list.each(&:release_connection)
end