Skip to content

Instantly share code, notes, and snippets.

@thilo
Forked from langalex/patiently.rb
Created June 11, 2010 12:22
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 thilo/434421 to your computer and use it in GitHub Desktop.
Save thilo/434421 to your computer and use it in GitHub Desktop.
holzhammer methode für Ajax Calls
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