taxonomydb.py 文件源码

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

项目:BioTaxIDMapper 作者: mkorycinski 项目源码 文件源码
def autoreconnect_retry(func, retries=3):
    """Decorating checking connection to the database."""
    def db_op_wrapper(*args, **kwargs):
        """Decorator wrapper"""
        tries = 0

        while tries < retries:
            try:
                return func(*args, **kwargs)

            except AutoReconnect:
                tries += 1

        raise Exception(
            "Couldn't connect to the database, even after %d retries" % retries)
    return db_op_wrapper
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号