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
评论列表
文章目录