Class: Delayed::Backend::ActiveRecord::ReleaseConnection
- Inherits:
-
Plugin
- Object
- Plugin
- Delayed::Backend::ActiveRecord::ReleaseConnection
- Defined in:
- lib/delayed/backend/active_record/release_connection.rb
Overview
Note:
Should be the last one in the plugin list.
Note:
‘require ’delayed/active_record/release_connection_plugin.rb’‘
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`
Class Method Summary collapse
Class Method Details
.call(_) ⇒ Object
17 18 19 20 |
# 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 |