示例#1
0
// GlobalInit is for global configuration reload-able.
func GlobalInit() {
	setting.NewConfigContext()
	log.Trace("Custom path: %s", setting.CustomPath)
	log.Trace("Log path: %s", setting.LogRootPath)
	mailer.NewMailerContext()
	models.LoadModelsConfig()
	NewServices()

	if setting.InstallLock {
		models.LoadRepoConfig()
		models.NewRepoContext()

		if err := models.NewEngine(); err != nil {
			log.Fatal(4, "Fail to initialize ORM engine: %v", err)
		}

		models.HasEngine = true
		cron.NewCronContext()
		log.NewGitLogger(path.Join(setting.LogRootPath, "http.log"))
	}
	if models.EnableSQLite3 {
		log.Info("SQLite3 Enabled")
	}
	checkRunMode()
}
示例#2
0
文件: web.go 项目: josephyzhou/gogs
// globalInit is for global configuration reload-able.
func globalInit() {
	base.NewConfigContext()
	mailer.NewMailerContext()
	models.LoadModelsConfig()
	models.LoadRepoConfig()
	models.NewRepoContext()
	models.NewEngine()
}
示例#3
0
// GlobalInit is for global configuration reload-able.
func GlobalInit() {
	base.NewConfigContext()
	mailer.NewMailerContext()
	models.LoadModelsConfig()
	models.LoadRepoConfig()
	models.NewRepoContext()

	if base.InstallLock {
		if err := models.NewEngine(); err != nil {
			fmt.Println("%v", err)
			os.Exit(2)
		}

		models.HasEngine = true
	}
	base.NewServices()
	checkRunMode()
}
示例#4
0
文件: install.go 项目: kennylixi/gogs
// GlobalInit is for global configuration reload-able.
func GlobalInit() {
	base.NewConfigContext()
	mailer.NewMailerContext()
	models.LoadModelsConfig()
	models.LoadRepoConfig()
	models.NewRepoContext()
	NewServices()

	if base.InstallLock {
		if err := models.NewEngine(); err != nil {
			qlog.Fatal(err)
		}

		models.HasEngine = true
		if models.EnableSQLite3 {
			log.Info("SQLite3 Enabled")
		}
		cron.NewCronContext()
	}
	checkRunMode()
}
示例#5
0
文件: install.go 项目: jcfrank/gogs
// GlobalInit is for global configuration reload-able.
func GlobalInit() {
	setting.NewConfigContext()
	log.Trace("Custom path: %s", setting.CustomPath)
	log.Trace("Log path: %s", setting.LogRootPath)
	mailer.NewMailerContext()
	models.LoadModelsConfig()
	models.LoadRepoConfig()
	models.NewRepoContext()
	NewServices()

	if setting.InstallLock {
		if err := models.NewEngine(); err != nil {
			qlog.Fatal(err)
		}

		models.HasEngine = true
		cron.NewCronContext()
	}
	if models.EnableSQLite3 {
		log.Info("SQLite3 Enabled")
	}
	checkRunMode()
}