Skip to content

Instantly share code, notes, and snippets.

@langalex
Created June 10, 2010 16:24
Show Gist options
  • Select an option

  • Save langalex/433240 to your computer and use it in GitHub Desktop.

Select an option

Save langalex/433240 to your computer and use it in GitHub Desktop.
def patiently(&block)
cycles = 0
begin
yield
rescue => e
cycles += 1
sleep 0.1
if cycles < 10
retry
else
raise e
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment