health: add warming-up warnable (#12553)

This commit is contained in:
Andrea Gottardo
2024-06-25 22:02:38 -07:00
committed by GitHub
parent 30f8d8199a
commit 6e55d8f6a1
4 changed files with 64 additions and 6 deletions
+15
View File
@@ -5,6 +5,7 @@ package health
import (
"fmt"
"time"
)
/**
@@ -212,3 +213,17 @@ var controlHealthWarnable = Register(&Warnable{
return fmt.Sprintf("The coordination server is reporting an health issue: %v", args[ArgError])
},
})
// warmingUpWarnableDuration is the duration for which the warmingUpWarnable is reported by the backend after the user
// has changed ipnWantRunning to true from false.
const warmingUpWarnableDuration = 5 * time.Second
// warmingUpWarnable is a Warnable that is reported by the backend when it is starting up, for a maximum time of
// warmingUpWarnableDuration. The GUIs use the presence of this Warnable to prevent showing any other warnings until
// the backend is fully started.
var warmingUpWarnable = Register(&Warnable{
Code: "warming-up",
Title: "Tailscale is starting",
Severity: SeverityLow,
Text: StaticMessage("Tailscale is starting. Please wait."),
})