func (g *GrafanaServerImpl) Start() { go listenToSystemSignals(g) writePIDFile() initRuntime() initSql() metrics.Init() search.Init() login.Init() social.NewOAuthService() eventpublisher.Init() plugins.Init() // init alerting if setting.ExecuteAlerts { engine := alerting.NewEngine() g.childRoutines.Go(func() error { return engine.Run(g.context) }) } // cleanup service cleanUpService := cleanup.NewCleanUpService() g.childRoutines.Go(func() error { return cleanUpService.Run(g.context) }) if err := notifications.Init(); err != nil { g.log.Error("Notification service failed to initialize", "erro", err) g.Shutdown(1, "Startup failed") return } g.startHttpServer() }
func Init() { if !setting.AlertingEnabled { return } engine = alerting.NewEngine() engine.Start() }