Class: RuboCop::Cop::Airbnb::NoTimeout

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/airbnb/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
RESTRICT_ON_SEND =
%i(timeout).freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



17
18
19
20
# File 'lib/rubocop/cop/airbnb/no_timeout.rb', line 17

def on_send(node)
  return unless timeout_const?(node.receiver)
  add_offense(node, message: MSG)
end