优化启动程序时初始化数据的代码逻辑

This commit is contained in:
dushixiang
2021-03-21 15:00:39 +08:00
parent fc631d2304
commit f3e2f81609
6 changed files with 79 additions and 33 deletions

View File

@ -34,9 +34,10 @@ func Run() error {
// 为了兼容之前调用global包的代码 后期预期会改为调用pgk/config
global.Config = config.GlobalCfg
global.Cache = api.SetupCache()
db := api.SetupDB()
e := api.SetupRoutes(db)
global.Cache = api.SetupCache()
if global.Config.ResetPassword != "" {
return api.ResetPassword()
}