INNER CODE UNIT · Go
_
VersusControl/versus-incident · cmd/main.go:241
_ = cat // catalog handle held by goroutine + admin controller
} else {
if err := startServiceHealth(healthManager, store, nil, cfg.Agent, nil); err != nil {
log.Fatalf("service health: failed to start: %v", err)
}
go scheduler.NewFromRegistry().Run(rootCtx)
}
// Mount the embedded UI LAST so it sits behind every API route. The
// SPA fallback inside MountStaticUI defers /api/* and /healthz back
// to the API handlers (which have already matched).
controllers.MountStaticUI(app)
// Trap SIGINT/SIGTERM so the HTTP server stops accepting connections
// and any background workers (currently just the agent) get a chance to
// flush state via rootCtx cancellation.
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)