Module: LoopHard::TimeoutTrap
- Defined in:
- lib/loop_hard/timeout_trap.rb
Class Method Summary collapse
-
.continue?(options) ⇒ Boolean
Returns false if the timeout has expired.
Class Method Details
.continue?(options) ⇒ Boolean
Returns false if the timeout has expired. True otherwise. Expects an options has with a ‘maximum_end_time` key.
7 8 9 10 11 12 13 |
# File 'lib/loop_hard/timeout_trap.rb', line 7 def continue?() if [:maximum_end_time] && Time.now > [:maximum_end_time] LoopHard.logger.info "Ending loop due to timeout" return false end return true end |