()
| 73 | } |
| 74 | |
| 75 | func runApp() { |
| 76 | c, err := conf.ReadConfig(path.GetConfigFilePath()) |
| 77 | if err != nil { |
| 78 | panic(err) |
| 79 | } |
| 80 | app, cleanup, err := initApplication( |
| 81 | c.Debug, c.Server, c.Data.Database, c.Data.Cache, c.I18n, c.Swaggerui, c.ServiceConfig, c.UI, log.GetLogger()) |
| 82 | if err != nil { |
| 83 | panic(err) |
| 84 | } |
| 85 | constant.Version = Version |
| 86 | constant.Revision = Revision |
| 87 | constant.GoVersion = GoVersion |
| 88 | schema.AppStartTime = time.Now() |
| 89 | fmt.Println("answer Version:", constant.Version, " Revision:", constant.Revision) |
| 90 | |
| 91 | defer cleanup() |
| 92 | if err := app.Run(context.Background()); err != nil { |
| 93 | panic(err) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func newApplication(serverConf *conf.Server, server *gin.Engine, manager *cron.ScheduledTaskManager) *pacman.Application { |
| 98 | manager.Run() |
no test coverage detected