Created
October 27, 2017 07:51
-
-
Save stereosupersonic/752ec277d699fcf74f6e2638155bc873 to your computer and use it in GitHub Desktop.
Retry
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
begin | |
result = some_method | |
rescue MyApp::Exception => e | |
retries ||= 0 | |
retries += 1 | |
raise e if retries > 5 | |
retry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment