fix(database): 解决SQLite数据库初始化问题
- 添加数据库文件创建逻辑确保文件存在 - 添加错误处理记录数据库创建失败日志 - 优化数据库初始化流程提高稳定性main v1.0.00008
parent
04736c3ba9
commit
dd8d406c33
|
|
@ -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())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue