INNER CODE UNIT · Go

InitApp

statping/statping · cmd/main.go:146

func InitApp() error {
	// fetch Core row information about this instance.
	if _, err := core.Select(); err != nil {
		return err
	}
	// init Sentry error monitoring (its useful)
	utils.SentryInit(core.App.AllowReports.Bool)
	// init prometheus metrics
	metrics.InitMetrics()
	// connect each notifier, added them into database if needed
	notifiers.InitNotifiers()
	// select all services in database and store services in a mapping of Service pointers
	if _, err := services.SelectAllServices(true); err != nil {
		return err
	}
	// start routines for each service checking process
	services.CheckServices()
	// start routine to delete old records (failures, hits)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…