diff --git a/cmd/cmd.go b/cmd/cmd.go index faac424c..bf305d81 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -898,7 +898,12 @@ func RunServer(cmd *cobra.Command, _ []string) error { return err } - return server.Serve(ln) + err = server.Serve(ln) + if errors.Is(err, http.ErrServerClosed) { + return nil + } + + return err } func initializeKeypair() error { diff --git a/server/routes.go b/server/routes.go index e878598a..da51fbbe 100644 --- a/server/routes.go +++ b/server/routes.go @@ -1041,6 +1041,7 @@ func Serve(ln net.Listener) error { signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM) go func() { <-signals + srvr.Close() done() sched.unloadAllRunners() gpu.Cleanup()