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 os | |
import sys | |
from functools import wraps | |
import gevent | |
import six | |
sys.stderr = open(os.devnull, 'w') | |
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
from functools import wraps | |
import gevent | |
import six | |
class DoRetry(object): | |
def __init__(self, times=2, interval=5, exponential_interval=True): | |
if not (interval > 0 and isinstance(times, int) and times > 0): | |
raise AttributeError('interval and times must be a positive') |