Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmd/register/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ func main() {

siteProb.Value = fmt.Sprintf("%f", probability)

// Set up health server.
// Set up health server. If it dies, exit so the supervisor restarts us:
// a silently dead /ready endpoint makes readiness checks fail forever
// while the process still looks healthy.
mux := http.NewServeMux()
mux.HandleFunc("/ready", Ready)
go http.ListenAndServe(*hcAddr, mux)
go func() {
rtx.Must(http.ListenAndServe(*hcAddr, mux), "Failed to serve /ready endpoint")
Comment thread
bassosimone marked this conversation as resolved.
}()

// Register for the first time.
register()
Expand Down
Loading