|
|
@@ -310,6 +310,7 @@ class MySQLConnectionPool:
|
|
|
:param args_list: 插入参数列表
|
|
|
:param batch_size: 每次插入的条数
|
|
|
"""
|
|
|
+ self.log.info(f"sql insert_too_many, Query: {query}, Total Rows: {len(args_list)}")
|
|
|
for i in range(0, len(args_list), batch_size):
|
|
|
batch = args_list[i:i + batch_size]
|
|
|
try:
|
|
|
@@ -317,6 +318,7 @@ class MySQLConnectionPool:
|
|
|
with conn.cursor() as cursor:
|
|
|
cursor.executemany(query, batch)
|
|
|
conn.commit()
|
|
|
+ self.log.debug(f"insert_too_many -> Total Rows: {len(batch)}")
|
|
|
except Exception as e:
|
|
|
self.log.error(f"insert_too_many error. Trying single insert. Error: {e}")
|
|
|
# 当前批次降级为单条插入
|