From aa0a28c01c866ae2d9b118ed72fde44980c2e3df Mon Sep 17 00:00:00 2001 From: Cody Roseborough Date: Tue, 15 Nov 2016 09:51:07 -0800 Subject: [PATCH] Adds IdleConnTimeout to transport in client --- .travis.yml | 11 +++-------- mgmt/rest/client/client.go | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf1aaad18..e5ec04ebf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ sudo: false language: go go: -- 1.6.3 -- 1.7.1 +- 1.7.3 before_install: - bash scripts/gitcookie.sh - go get github.com/smartystreets/goconvey/convey @@ -16,10 +15,6 @@ env: - SNAP_TEST_TYPE=small - SNAP_TEST_TYPE=medium - SNAP_TEST_TYPE=build -matrix: - exclude: - - go: 1.6.3 - env: SNAP_TEST_TYPE=build install: - export TMPDIR=$HOME/tmp - mkdir -p $TMPDIR @@ -48,7 +43,7 @@ deploy: on: repo: intelsdi-x/snap branch: master - condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.7.1" + condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.7.3" - provider: s3 access_key_id: AKIAINMB43VSSPFZISAA secret_access_key: @@ -62,4 +57,4 @@ deploy: on: repo: intelsdi-x/snap tags: true - condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.7.1" + condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.7.3" diff --git a/mgmt/rest/client/client.go b/mgmt/rest/client/client.go index d1a799ce6..efc66aecf 100644 --- a/mgmt/rest/client/client.go +++ b/mgmt/rest/client/client.go @@ -34,6 +34,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/asaskevich/govalidator" @@ -104,9 +105,11 @@ func Username(u string) metaOp { var ( secureTransport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, + IdleConnTimeout: time.Second, } insecureTransport = &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + IdleConnTimeout: time.Second, } )