mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-04 23:45:07 +00:00
test timeouts
This commit is contained in:
parent
14db628856
commit
498542c983
@ -76,6 +76,7 @@ type Config struct {
|
||||
LogStore *logstore.Configs
|
||||
Quotas *QuotasConfig
|
||||
Telemetry *handlers.TelemetryPusherConfig
|
||||
TimeoutTest test
|
||||
}
|
||||
|
||||
type QuotasConfig struct {
|
||||
|
@ -344,7 +344,7 @@ func startZitadel(ctx context.Context, config *Config, masterKey string, server
|
||||
close(server)
|
||||
}
|
||||
|
||||
return listen(ctx, router, config.Port, tlsConfig, shutdown)
|
||||
return listen(ctx, router, config.Port, tlsConfig, shutdown, config.TimeoutTest)
|
||||
}
|
||||
|
||||
func startAPIs(
|
||||
@ -558,9 +558,14 @@ func startAPIs(
|
||||
return apis, nil
|
||||
}
|
||||
|
||||
func listen(ctx context.Context, router *mux.Router, port uint16, tlsConfig *tls.Config, shutdown <-chan os.Signal) error {
|
||||
http2Server := &http2.Server{}
|
||||
http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig}
|
||||
type test struct {
|
||||
IdleTimeout time.Duration
|
||||
ReadTimeout time.Duration
|
||||
}
|
||||
|
||||
func listen(ctx context.Context, router *mux.Router, port uint16, tlsConfig *tls.Config, shutdown <-chan os.Signal, test test) error {
|
||||
http2Server := &http2.Server{IdleTimeout: test.IdleTimeout}
|
||||
http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig, ReadTimeout: test.ReadTimeout, IdleTimeout: test.IdleTimeout}
|
||||
|
||||
lc := net.ListenConfig()
|
||||
lis, err := lc.Listen(ctx, "tcp", fmt.Sprintf(":%d", port))
|
||||
|
Loading…
Reference in New Issue
Block a user