Merge lp:~verterok/ubuntu-push/extra-options-for-kit-api-client into lp:ubuntu-push/automatic

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 360
Merged at revision: 360
Proposed branch: lp:~verterok/ubuntu-push/extra-options-for-kit-api-client
Merge into: lp:ubuntu-push/automatic
Diff against target: 38 lines (+6/-3)
2 files modified
server/acceptance/kit/api.go (+4/-2)
server/acceptance/suites/suite.go (+2/-1)
To merge this branch: bzr merge lp:~verterok/ubuntu-push/extra-options-for-kit-api-client
Reviewer Review Type Date Requested Status
Bret Barker (community) Approve
Review via email: mp+247901@code.launchpad.net

Commit message

Add DisableKeepAlives and MaxIdleConnsPerHost to the APIClient SetupClient method.

Description of the change

add DisableKeepAlives and MaxIdleConnsPerHost to the APIClient SetupClient method.

To post a comment you must log in.
Revision history for this message
Bret Barker (noise) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/acceptance/kit/api.go'
2--- server/acceptance/kit/api.go 2015-01-23 16:11:08 +0000
3+++ server/acceptance/kit/api.go 2015-01-28 21:43:44 +0000
4@@ -45,9 +45,11 @@
5 }
6
7 // SetupClient sets up the http client to make requests.
8-func (api *APIClient) SetupClient(tlsConfig *tls.Config) {
9+func (api *APIClient) SetupClient(tlsConfig *tls.Config, disableKeepAlives bool, maxIdleConnsPerHost int) {
10 api.httpClient = &http.Client{
11- Transport: &http.Transport{TLSClientConfig: tlsConfig},
12+ Transport: &http.Transport{TLSClientConfig: tlsConfig,
13+ DisableKeepAlives: disableKeepAlives,
14+ MaxIdleConnsPerHost: maxIdleConnsPerHost},
15 }
16 }
17
18
19=== modified file 'server/acceptance/suites/suite.go'
20--- server/acceptance/suites/suite.go 2014-12-08 16:31:25 +0000
21+++ server/acceptance/suites/suite.go 2015-01-28 21:43:44 +0000
22@@ -21,6 +21,7 @@
23 "flag"
24 "fmt"
25 "net"
26+ "net/http"
27 "os"
28 "regexp"
29 "runtime"
30@@ -108,7 +109,7 @@
31 c.Assert(s.ServerHandle.ServerEvents, NotNil)
32 c.Assert(s.ServerHandle.ServerAddr, Not(Equals), "")
33 c.Assert(s.ServerAPIURL, Not(Equals), "")
34- s.SetupClient(nil)
35+ s.SetupClient(nil, false, http.DefaultMaxIdleConnsPerHost)
36 }
37
38 func (s *AcceptanceSuite) TearDownTest(c *C) {

Subscribers

People subscribed via source and target branches