Class: Gruf::Hooks::ActiveRecord::ConnectionReset

Inherits:
Base
  • Object
show all
Defined in:
lib/gruf/hooks/active_record/connection_reset.rb

Overview

Resets the ActiveRecord connection to maintain accurate connected state in the thread pool

Instance Attribute Summary

Attributes inherited from Base

#options, #service

Instance Method Summary collapse

Methods inherited from Base

#initialize, #setup

Methods included from Loggable

#logger

Constructor Details

This class inherits a constructor from Gruf::Hooks::Base

Instance Method Details

#after(_success, _response, _call_signature, _req, _call) ⇒ Object



24
25
26
# File 'lib/gruf/hooks/active_record/connection_reset.rb', line 24

def after(_success, _response, _call_signature, _req, _call)
  ::ActiveRecord::Base.clear_active_connections! if enabled?
end