Created
May 3, 2011 04:59
-
-
Save bcoe/952839 to your computer and use it in GitHub Desktop.
love.py
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
import time | |
def retry(f): | |
MAXIMUM_RETRIES = 24 | |
SLEEP_TIME = 5 | |
def wrapper(*args): | |
for tries in range(0, MAXIMUM_RETRIES): | |
try: | |
return f(*args) | |
except Exception: | |
time.sleep(SLEEP_TIME) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment