Class: RuboCop::Cop::Ezcater::RubyTimeout
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Ezcater::RubyTimeout
- Defined in:
- lib/rubocop/cop/ezcater/ruby_timeout.rb
Overview
Don’t use Timeout.timeout because it can cause transient errors
Constant Summary collapse
- MSG =
<<~END_MESSAGE.split("\n").join(" ") `Timeout.timeout` is unsafe. Find an alternative to achieve the same goal. Ex. Use the timeout capabilities of a networking library. Ex. Iterate and check runtime after each iteration. END_MESSAGE
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
31 32 33 34 35 |
# File 'lib/rubocop/cop/ezcater/ruby_timeout.rb', line 31 def on_send(node) timeout(node) do add_offense(node, location: :expression, message: MSG) end end |