feat: expose graceful drain state

This commit is contained in:
2026-09-20 20:15:36 +08:00
parent 9153ddf85f
commit 99e2a00fcf
6 changed files with 22 additions and 2 deletions

View File

@@ -259,6 +259,9 @@ func run() error {
return err
case <-root.Done():
readiness.BeginDrain()
if metrics != nil {
metrics.RecordDraining(true)
}
shutdown, cancel := context.WithTimeout(context.Background(), cfg.ShutdownTimeout)
defer cancel()
if err := server.Shutdown(shutdown); err != nil {