Merge pull request #55 from docker/fix-increase-handler-timeout

fix: increase handler timeout
This commit is contained in:
Joel Kamp
2024-07-26 10:09:53 -05:00
committed by GitHub

10
main.go
View File

@@ -17,7 +17,6 @@ import (
)
const (
handlerTimeout = 15 * time.Second
readHeaderTimeout = 1 * time.Second
)
@@ -29,9 +28,10 @@ const (
)
var (
certDir string
clientCAFile string
port int
certDir string
clientCAFile string
port int
handlerTimeoutSeconds int
tufRoot string
tufoutputPath string
@@ -62,6 +62,7 @@ func init() {
flag.StringVar(&certDir, "cert-dir", "", "path to directory containing TLS certificates")
flag.StringVar(&clientCAFile, "client-ca-file", "", "path to client CA certificate")
flag.IntVar(&port, "port", defaultPort, "Port for the server to listen on")
flag.IntVar(&handlerTimeoutSeconds, "handler-timeout", 25, "timeout for handler in seconds")
flag.StringVar(&tufRoot, "tuf-root", "prod", "specify embedded tuf root [dev, staging, prod], default [prod]")
flag.StringVar(&metadataURL, "tuf-metadata-source", defaultMetadataURL, "source (URL or repo) for TUF metadata")
@@ -79,6 +80,7 @@ func init() {
func main() {
mux := http.NewServeMux()
handlerTimeout := time.Duration(handlerTimeoutSeconds) * time.Second
validateHandler, err := handler.NewValidateHandler(&handler.ValidateHandlerOptions{
TUFRoot: tufRoot,