fix(xray): implement graceful shutdown for xray process and add tests (#4259)

This commit is contained in:
Farhad H. P. Shirvan
2026-05-11 14:11:40 +02:00
committed by GitHub
parent e642f7324e
commit 9318c2105f
4 changed files with 265 additions and 24 deletions
+3 -1
View File
@@ -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()