|
@@ -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)
|
|
-
|
|
|