fix(database): 解决SQLite数据库初始化问题

- 添加数据库文件创建逻辑确保文件存在
- 添加错误处理记录数据库创建失败日志
- 优化数据库初始化流程提高稳定性
main v1.0.00008
black1552 2026-02-03 14:32:50 +08:00
parent 04736c3ba9
commit dd8d406c33
1 changed files with 5 additions and 0 deletions

View File

@ -67,5 +67,10 @@ func mysqlInit() {
} }
func sqliteInit() { func sqliteInit() {
_, err = gfile.Create(dns.String())
if err != nil {
log.Error("创建数据库文件失败: ", err)
return
}
Type = sqlite.Open(dns.String()) Type = sqlite.Open(dns.String())
} }