From 7367e11d6e11087fdb54b3bc3813e774fa3c3823 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 10 May 2021 01:12:23 +0800 Subject: [PATCH] up --- plugins/mysql/class/mysqlDb.py | 2 +- plugins/mysql/index.py | 6 +++++- requirements.txt | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/class/mysqlDb.py b/plugins/mysql/class/mysqlDb.py index 1a910bb42..45b65b356 100755 --- a/plugins/mysql/class/mysqlDb.py +++ b/plugins/mysql/class/mysqlDb.py @@ -77,7 +77,7 @@ class mysqlDb: self.__DB_CUR.execute(sql) result = self.__DB_CUR.fetchall() # 将元组转换成列表 - data = map(list, result) + data = list(map(list, result)) self.__Close() return data except Exception as ex: diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 17ad4a9c0..87ce7ecfe 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -519,10 +519,14 @@ def runInfo(): pass result = {} + + # print(data) for d in data: for g in gets: if d[0] == g: result[g] = d[1] + + # print(result, int(result['Uptime'])) result['Run'] = int(time.time()) - int(result['Uptime']) tmp = db.query('show master status') try: @@ -1666,7 +1670,7 @@ from threading import Thread from time import sleep -def async(f): +def mw_async(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() diff --git a/requirements.txt b/requirements.txt index edcc4e79c..6968b4f0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,5 @@ python-engineio==3.13.2 python-socketio==4.2.0 Flask-SocketIO==3.0.2 zmq==0.0.0 +mysqlclient==2.0.3 # pytest-shutil \ No newline at end of file