diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index f46f0119..c0e63b56 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -60,6 +60,8 @@ def db_insert_mplogx(): cursor.execute( "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() update_sysconfig({'enm': {'last_tag_id': last_tag_id}})