Skip to content

Commit

Permalink
fix: 纯属意外(确信)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikun0014 authored and helloplhm-qwq committed Feb 22, 2024
1 parent f884960 commit 715206e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# 创建线程本地存储对象
local_data = threading.local()

if not os.path.exists('data'):
os.mkdir('data')

def get_data_connection():
# 检查线程本地存储对象是否存在连接对象,如果不存在则创建一个新的连接对象
Expand Down Expand Up @@ -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()
Expand All @@ -657,7 +659,7 @@ def initConfig():

conn.close()

conn2 = sqlite3.connect('data.db')
conn2 = sqlite3.connect('./data/data.db')

# 创建一个游标对象
cursor2 = conn2.cursor()
Expand Down
2 changes: 1 addition & 1 deletion common/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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
Expand Down

0 comments on commit 715206e

Please sign in to comment.