Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created January 24, 2012 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/1669888 to your computer and use it in GitHub Desktop.
Save AndrewVos/1669888 to your computer and use it in GitHub Desktop.
def timeout_without_errors time, &block
begin
timeout(time){ block.call }
rescue Timeout::Error
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment