Class: Dblint::Checks::LongHeldLock
- Defined in:
- lib/dblint/checks/long_held_lock.rb
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
-
#initialize ⇒ LongHeldLock
constructor
A new instance of LongHeldLock.
- #statement_finished(_name, _id, payload) ⇒ Object
- #statement_started(_name, _id, _payload) ⇒ Object
Methods inherited from Base
#check_name, #config, #find_main_app_caller, #ignored?
Constructor Details
#initialize ⇒ LongHeldLock
Returns a new instance of LongHeldLock.
6 7 8 9 |
# File 'lib/dblint/checks/long_held_lock.rb', line 6 def initialize @locks_held = {} @existing_ids = {} end |
Instance Method Details
#statement_finished(_name, _id, payload) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dblint/checks/long_held_lock.rb', line 15 def statement_finished(_name, _id, payload) if payload[:sql] == 'BEGIN' handle_begin elsif payload[:sql] == 'COMMIT' handle_commit elsif payload[:sql] == 'ROLLBACK' # do nothing elsif @existing_ids.present? increment_locks_held add_new_locks_held(payload) end end |
#statement_started(_name, _id, _payload) ⇒ Object
11 12 13 |
# File 'lib/dblint/checks/long_held_lock.rb', line 11 def statement_started(_name, _id, _payload) # Ignored end |