INNER CODE UNIT · Go
timer
nicholasjackson/fake-service · main.go:320
timer := time.AfterFunc(30*time.Second, func() {
grpcServer.Stop() // force stop the server
})
grpcServer.GracefulStop()
timer.Stop()
// gracefully shutdown the HTTP server, waiting max 30 seconds for current operations to complete
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
httpServer.Shutdown(ctx)
m.Close()
}
//go:embed ui/build
var uiFiles embed.FS