fix(database): 解决SQLite数据库初始化问题
- 添加数据库文件创建逻辑确保文件存在 - 添加错误处理记录数据库创建失败日志 - 优化数据库初始化流程提高稳定性
This commit is contained in:
@@ -67,5 +67,10 @@ func mysqlInit() {
|
||||
}
|
||||
|
||||
func sqliteInit() {
|
||||
_, err = gfile.Create(dns.String())
|
||||
if err != nil {
|
||||
log.Error("创建数据库文件失败: ", err)
|
||||
return
|
||||
}
|
||||
Type = sqlite.Open(dns.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user