INNER CODE UNIT · Go
startupTimeout
casosorg/casos · main.go:286
const startupTimeout = 60 * time.Second
// openWhenReady opens the CasOS web UI once the server answers, and reports the
// failure in a dialog if it never does.
//
// It runs only for a CasOS started by double-clicking casos.exe. That user has
// no terminal to read a URL out of and no reason to expect one, and the console
// window they do get is buried under Kubernetes logs within seconds — so both
// the address and any startup failure have to reach them some other way.
func openWhenReady(port int) {
webURL := fmt.Sprintf("http://localhost:%d/", port)
if err := util.WaitForServer(webURL, startupTimeout); err != nil {
logs.Warning("startup: %v", err)
util.ReportStartupFailure(fmt.Sprintf(
"CasOS did not finish starting within %s.\n\n"+
"The CasOS console window shows what went wrong. The most common "+
"cause is port %d already being in use by another program — change "+