fundamental.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:QUANTAXIS 作者: yutiansut 项目源码 文件源码
def retry(times=3):
    def wrapper(func):
        @wraps(func)
        def fun(*args, **kwargs):
            count = 0
            while count < times:
                try:
                    return func(*args, **kwargs)
                except Exception as e:
                    count = count + 1

            logger.error("connection failed after retried 3 times. {} {}".format(args, kwargs))
            raise Exception("connection failed after retried 3 times. {} {}".format(args, kwargs))

        return fun

    return wrapper
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号