fix(httpproxy): lower shutdown wait from 2s to 100ms

This commit is contained in:
Quentin McGaw
2022-10-31 11:21:25 +00:00
parent 1d1657e9be
commit 192a7a56a3

View File

@@ -39,7 +39,7 @@ func (s *Server) Run(ctx context.Context, errorCh chan<- error) {
} }
go func() { go func() {
<-ctx.Done() <-ctx.Done()
const shutdownGraceDuration = 2 * time.Second const shutdownGraceDuration = 100 * time.Millisecond
shutdownCtx, cancel := context.WithTimeout(context.Background(), shutdownGraceDuration) shutdownCtx, cancel := context.WithTimeout(context.Background(), shutdownGraceDuration)
defer cancel() defer cancel()
if err := server.Shutdown(shutdownCtx); err != nil { if err := server.Shutdown(shutdownCtx); err != nil {