datahandler.py 文件源码

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

项目:palantiri 作者: anidata 项目源码 文件源码
def find_by_id(self, _id, attempt = 0):
        with self.conn.cursor() as cur:
            try:
                cur.execute(
                """SELECT id FROM page WHERE url = '{}'""".format(_id)
                    )
                return cur.fetchone()
            except (psycopg2.IntegrityError, psycopg2.InternalError) as err:
                if attempt < 5:
                    return self.find_by_id(_id, attempt + 1)
                else:
                    raise err
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号