fix(xray): implement graceful shutdown for xray process and add tests (#4259)
This commit is contained in:
committed by
GitHub
parent
e642f7324e
commit
9318c2105f
+3
-1
@@ -456,7 +456,9 @@ func (s *Server) Stop() error {
|
||||
var err1 error
|
||||
var err2 error
|
||||
if s.httpServer != nil {
|
||||
err1 = s.httpServer.Shutdown(s.ctx)
|
||||
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer shutdownCancel()
|
||||
err1 = s.httpServer.Shutdown(shutdownCtx)
|
||||
}
|
||||
if s.listener != nil {
|
||||
err2 = s.listener.Close()
|
||||
|
||||
Reference in New Issue
Block a user