fgksgf commented on a change in pull request #573:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/573#discussion_r698236045



##########
File path: pkg/api/server.go
##########
@@ -67,13 +99,51 @@ func NewServer(cfg *config.Config) (*Server, error) {
 func (srv *Server) Run(stopCh <-chan struct{}) error {
        go func() {
                <-stopCh
-               if err := srv.httpListener.Close(); err != nil {
-                       log.Errorf("failed to close http listener: %s", err)
+               ctx, cancel := context.WithTimeout(context.Background(), 
5*time.Second)
+               defer cancel()
+
+               closeHttp := make(chan struct{})
+               go srv.closeHttpServer(closeHttp)

Review comment:
       should I put the timeout into the config?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to