Class: RuboCop::Cop::Airbnb::NoTimeout
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Airbnb::NoTimeout
- 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
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
12 13 14 15 |
# File 'lib/rubocop/cop/airbnb/no_timeout.rb', line 12 def on_send(node) return unless node.source.start_with?('Timeout.timeout') add_offense(node, message: MSG) end |