Class: RuboCop::Cop::Sequioacap::NoTimeout

Inherits:
RuboCop::Cop show all
Defined in:
lib/rubocop/cop/sequioacap/no_timeout.rb

Constant Summary collapse

MSG =
'Do not use Timeout.timeout. In combination with Rails autoloading, ' \
'timeout can cause Segmentation Faults in version of Ruby we use. ' \
'It can also cause logic errors since it can raise in ' \
'any callee scope. Use client library timeouts and monitoring to ' \
'ensure proper timing behavior for web requests.'.freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



16
17
18
19
# File 'lib/rubocop/cop/sequioacap/no_timeout.rb', line 16

def on_send(node)
  return unless node.source.start_with?('Timeout.timeout')
  add_offense(node, message: MSG)
end