12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/txnap/notifier.rb', line 12
def call(report)
return false unless report
return false unless report.longest_gap.duration >= configuration.gap_threshold
return false unless report.transaction_duration >= configuration.min_transaction_duration
return false if configuration.only_with_locks && report.locks.empty?
return false if ExecutionState.suppressed?
return false if ignored?(report)
ActiveSupport::Notifications.instrument(EVENT_NAME, report.to_h)
message = Formatter.new.call(report)
raise IdleGapDetected, raise_message(message, report) if configuration.mode == :raise
logger.warn(message)
true
end
|