📝 output log when server shutdown is failed

This commit is contained in:
Keisuke Ishigami 2024-11-21 00:58:27 +09:00
parent c9092f69fc
commit dd1300df98

View File

@ -236,8 +236,11 @@ func RunServer(
defer close(serverShutdownCh)
<-stopCh
ctx, cancel := context.WithTimeout(context.Background(), shutDownTimeout)
server.Shutdown(ctx)
cancel()
defer cancel()
err := server.Shutdown(ctx)
if err != nil {
klog.Errorf("Failed to shutdown server: %v", err)
}
}()
go func() {