fix: db_insert_mplogx bug

This commit is contained in:
caoqianming 2024-07-16 15:36:40 +08:00
parent d31cf4d143
commit 83ec822f9d
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,8 @@ def db_insert_mplogx():
cursor.execute( cursor.execute(
"select id, val, tag_code, update_time from tag_value where id > %s order by id, update_time", (last_tag_id)) "select id, val, tag_code, update_time from tag_value where id > %s order by id, update_time", (last_tag_id))
rows = cursor.fetchall() # 获取数据后保存至本地 rows = cursor.fetchall() # 获取数据后保存至本地
if rows:
last_tag_id = rows[-1][0]
MyThread(target=db_insert_mplogx_batch, args=(rows,)).start() MyThread(target=db_insert_mplogx_batch, args=(rows,)).start()
update_sysconfig({'enm': {'last_tag_id': last_tag_id}}) update_sysconfig({'enm': {'last_tag_id': last_tag_id}})