fix: 纯属意外(确信)

This commit is contained in:
ikun0014 2024-02-22 18:51:06 +08:00 committed by 梓澄qwq
parent f88496023f
commit 715206ea6a
2 changed files with 5 additions and 3 deletions

View File

@ -22,6 +22,8 @@ logger = log('config_manager')
# 创建线程本地存储对象
local_data = threading.local()
if not os.path.exists('data'):
os.mkdir('data')
def get_data_connection():
# 检查线程本地存储对象是否存在连接对象,如果不存在则创建一个新的连接对象
@ -643,7 +645,7 @@ def initConfig():
variable.log_length_limit = read_config('common.log_length_limit')
variable.debug_mode = read_config('common.debug_mode')
logger.debug("配置文件加载成功")
conn = sqlite3.connect('cache.db')
conn = sqlite3.connect('./data/cache.db')
# 创建一个游标对象
cursor = conn.cursor()
@ -657,7 +659,7 @@ data TEXT NOT NULL)''')
conn.close()
conn2 = sqlite3.connect('data.db')
conn2 = sqlite3.connect('./data/data.db')
# 创建一个游标对象
cursor2 = conn2.cursor()

View File

@ -12,7 +12,7 @@ import ujson as _json
def _read_config_file():
try:
with open("./config.json", "r", encoding = "utf-8") as f:
with open("./data/config.json", "r", encoding = "utf-8") as f:
return _json.load(f)
except:
pass