database.py 文件源码

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

项目:assetsweeper 作者: guardian 项目源码 文件源码
def insert_sysparam(self,key,value):
        cursor=self.conn.cursor()
        for attempt in range(1,10):
            try:
                cursor.execute("insert into system (key,value,pid) values (%s,%s,%s)", (key, value, os.getpid()))
                break
            except psycopg2.InternalError: #if we have an aborted transaction, cleanup and then re-try
                self.conn.rollback()
                continue
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号