Last active
May 12, 2020 08:52
-
-
Save ArturLyapin/8759d100a04a9a4b2424bf5565e3d7f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'timeout' | |
require 'net/http' | |
Timeout.timeout(2, Timeout::Error) do | |
begin | |
sleep(5) | |
rescue StandardError => e | |
puts e | |
puts 'Fuck yeah' | |
sleep(3) | |
ensure | |
puts 'Fuck yeah 2' | |
sleep(3) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment