Skip to content

Instantly share code, notes, and snippets.

@ArturLyapin
Last active May 12, 2020 08:52
Show Gist options
  • Save ArturLyapin/8759d100a04a9a4b2424bf5565e3d7f5 to your computer and use it in GitHub Desktop.
Save ArturLyapin/8759d100a04a9a4b2424bf5565e3d7f5 to your computer and use it in GitHub Desktop.
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