- 替换 sqlite 驱动为 github.com/glebarez/sqlite

- 修复数据库锁定的问题
- 修复部分代码不完善的问题
- 修复策略显示不完整的问题
- 修复编辑文件换行符的问题
- 优化guacd连接
This commit is contained in:
dushixiang
2022-03-29 22:31:08 +08:00
parent 03114b486c
commit d393d28e5e
42 changed files with 435 additions and 567 deletions

View File

@ -26,13 +26,6 @@ func newApp() *App {
func init() {
setupCache()
app = newApp()
if err := app.InitDBData(); err != nil {
panic(err)
}
if err := app.ReloadData(); err != nil {
panic(err)
}
app.Server = setupRoutes()
}
func (app App) InitDBData() (err error) {
@ -96,7 +89,15 @@ func (app App) ReloadData() error {
func Run() error {
fmt.Printf(constant.Banner, constant.Version)
fmt.Printf(constant.AppBanner, constant.AppVersion)
if err := app.InitDBData(); err != nil {
panic(err)
}
if err := app.ReloadData(); err != nil {
panic(err)
}
app.Server = setupRoutes()
if config.GlobalCfg.Debug {
jsonBytes, err := json.MarshalIndent(config.GlobalCfg, "", " ")