This commit is contained in:
dami 2025-04-02 12:48:06 +08:00
parent 142f0fc6c9
commit 628b65a569
2 changed files with 8 additions and 6 deletions

View File

@ -10,6 +10,8 @@ import re
import json
from packaging import version
web_dir = os.getcwd() + "/web"
if os.path.exists(web_dir):
sys.path.append(web_dir)
@ -854,8 +856,8 @@ def runInfo(version):
return mw.getJson(result)
def myDbStatus(version):
if status(version) == 'stop':
def myDbStatus(ver):
if status(ver) == 'stop':
return mw.returnJson(False, 'MySQL未启动', [])
result = {}
@ -868,7 +870,7 @@ def myDbStatus(version):
gets = ['table_open_cache', 'thread_cache_size', 'key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size',
'innodb_additional_mem_pool_size', 'innodb_log_buffer_size', 'max_connections', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']
if version != "8.0":
if version.parse(ver) < version.parse("8.0"):
gets.append('query_cache_size')
result['mem'] = {}
@ -881,12 +883,11 @@ def myDbStatus(version):
return mw.getJson(result)
def setDbStatus(version):
def setDbStatus(ver):
gets = ['key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections',
'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']
if version != "8.0":
# gets.append('query_cache_size')
if version.parse(ver) < version.parse("8.0"):
gets = ['key_buffer_size', 'query_cache_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections',
'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']

View File

@ -43,3 +43,4 @@ pyTelegramBotAPI
telebot
pyyaml
croniter
packaging