Answers for "rails timeoutable"

0

timeout in rails

require 'timeout'

def test
  Timeout.timeout(5) do # 5 seconds
    sleep 6
  end
rescue
  puts 'timeout'
end
Posted by: Guest on October-30-2021

Browse Popular Code Answers by Language