Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

timeout in rails

require 'timeout'

def test
  Timeout.timeout(5) do # 5 seconds
    sleep 6
  end
rescue
  puts 'timeout'
end 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #timeout #rails
ADD COMMENT
Topic
Name
8+8 =