Skip to content

Commit 56350c1

Browse files
committed
Add http_timeout flag to CT Hammer
1 parent 57f823d commit 56350c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/hammer/hammer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ var (
7878
bearerToken = flag.String("bearer_token", "", "The bearer token for auth. For GCP this is the result of `gcloud auth print-access-token`")
7979
bearerTokenWrite = flag.String("bearer_token_write", "", "The bearer token for auth to write. For GCP this is the result of `gcloud auth print-identity-token`. If unset will default to --bearer_token.")
8080

81-
forceHTTP2 = flag.Bool("force_http2", false, "Use HTTP/2 connections *only*")
81+
httpTimeout = flag.Duration("http_timeout", 10*time.Second, "Timeout for HTTP requests")
82+
forceHTTP2 = flag.Bool("force_http2", false, "Use HTTP/2 connections *only*")
8283

8384
hc = &http.Client{
8485
Transport: &http.Transport{
8586
MaxIdleConns: 256,
8687
MaxIdleConnsPerHost: 256,
8788
DisableKeepAlives: false,
8889
},
89-
Timeout: 5 * time.Second,
90+
Timeout: *httpTimeout,
9091
}
9192
)
9293

0 commit comments

Comments
 (0)