From e2455733611144e47284e5398183f7b28a016983 Mon Sep 17 00:00:00 2001 From: Tyler Date: Wed, 16 Oct 2019 19:13:27 -0400 Subject: [PATCH] Change default timeout to 15s --- service/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service/main.go b/service/main.go index d7d8300..b2083e9 100644 --- a/service/main.go +++ b/service/main.go @@ -70,6 +70,10 @@ func main() { if err != nil { log.Fatalln("Unable to bind client to address:", err) } + } else { + api.Client = &http.Client{ + Timeout: 15 * time.Second, + } } if config.Cache != "" { @@ -148,8 +152,8 @@ func constructBoundClient(addr string) (*http.Client, error) { dialer := &net.Dialer{ LocalAddr: &localTCPAddr, - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, + Timeout: 15 * time.Second, + KeepAlive: 15 * time.Second, } return &http.Client{