Class: Middleware::Sidekiq::ActiveRecordConnectionPool
- Inherits:
-
Object
- Object
- Middleware::Sidekiq::ActiveRecordConnectionPool
- Defined in:
- lib/middleware/sidekiq/active_record_connection_pool.rb
Overview
Sidekiq middleware to clear the ActiveRecord connection pool after each job.
Instance Method Summary collapse
-
#call ⇒ Object
Allows the job to be processed, then clears the ActiveRecord connection pool.
Instance Method Details
#call ⇒ Object
Allows the job to be processed, then clears the ActiveRecord connection pool.
35 36 37 38 39 40 41 42 43 |
# File 'lib/middleware/sidekiq/active_record_connection_pool.rb', line 35 def call(*) yield ensure begin ActiveRecord::Base.connection_handler.clear_active_connections! rescue => error warn error. end end |