feat: db_insert_mplogx不用thread

This commit is contained in:
caoqianming 2024-07-30 10:01:42 +08:00
parent f5c22d460b
commit 893781ec7f
1 changed files with 2 additions and 2 deletions

View File

@ -58,11 +58,11 @@ def db_insert_mplogx():
if count > 400:
raise Exception("db inset count > 400")
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() # 获取数据后保存至本地
if rows:
last_tag_id = rows[-1][0]
MyThread(target=db_insert_mplogx_batch, args=(rows,)).start()
db_insert_mplogx_batch(rows)
update_sysconfig({'enm': {'last_tag_id': last_tag_id}})