cmd/stepd: Surpress some go vet warnings

This commit is contained in:
Sasha Koshka 2024-12-11 02:50:20 -05:00
parent f8b739ac4d
commit ce6c5b6285

View File

@ -201,16 +201,15 @@ func main () {
} }
// set up the HTTP server // set up the HTTP server
httpServer := http.Server { httpServer := httpServerRoutine {
Addr: config.Get("http.address"), Addr: config.Get("http.address"),
Handler: &handler, Handler: &handler,
} }
httpServerRoutine := httpServerRoutine(httpServer)
// set up the routine manager // set up the routine manager
manager := routines.Manager { manager := routines.Manager {
Routines: []routines.Routine { Routines: []routines.Routine {
&httpServerRoutine, &httpServer,
}, },
} }
@ -230,9 +229,10 @@ func (this *httpServerRoutine) Run (ctx context.Context) error {
server := http.Server(*this) server := http.Server(*this)
go func () { go func () {
<- ctx.Done() <- ctx.Done()
shutdownCtx, _ := context.WithTimeout ( shutdownCtx, done := context.WithTimeout (
context.Background(), context.Background(),
16 * time.Second) 16 * time.Second)
defer done()
server.Shutdown(shutdownCtx) server.Shutdown(shutdownCtx)
} () } ()
err := server.ListenAndServe() err := server.ListenAndServe()