renyupeng 3 年之前
父节点
当前提交
522c666edb
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      Apietl/conn/TidbConn.py

+ 2 - 3
Apietl/conn/TidbConn.py

@@ -71,10 +71,10 @@ class TidbConn:
         return cur
         return cur
 
 
     @staticmethod
     @staticmethod
-    def upsert(sql):
+    def upsert(conn, sql_buff):
         TidbConn._reConn(num=28800, stime=3)
         TidbConn._reConn(num=28800, stime=3)
         try:
         try:
-            TidbConn.exec_sql(TidbConn.get_connection(), sql)
+            TidbConn.exec_sql(conn, sql_buff)
         except Exception as e:
         except Exception as e:
             logging.error('失败详细信息:', repr(e))
             logging.error('失败详细信息:', repr(e))
         TidbConn.get_connection().commit()
         TidbConn.get_connection().commit()
@@ -88,4 +88,3 @@ if __name__ == '__main__':
     cursor.execute(sql)
     cursor.execute(sql)
     result = cursor.fetchall()
     result = cursor.fetchall()
     print("result====", result)
     print("result====", result)
-