~egtann/sjs

df454eeb7eb4fb97c82d2c607803a1d7606687e9 — Evan Tann 1 year, 7 months ago 8814003
use cleanhttp to fix keepalives file descriptor bug
3 files changed, 7 insertions(+), 4 deletions(-)

M go.mod
M go.sum
M http/client.go
M go.mod => go.mod +1 -0
@@ 1,6 1,7 @@
module github.com/egtann/sjs

require (
	github.com/hashicorp/go-cleanhttp v0.5.1
	github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da
	github.com/pkg/errors v0.8.1
)

M go.sum => go.sum +2 -0
@@ 1,3 1,5 @@
github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da h1:5y58+OCjoHCYB8182mpf/dEsq0vwTKPOo4zGfH0xW9A=
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da/go.mod h1:oLH0CmIaxCGXD67VKGR5AacGXZSMznlmeqM8RzPrcY8=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=

M http/client.go => http/client.go +4 -4
@@ 9,6 9,7 @@ import (
	"time"

	"github.com/egtann/sjs"
	"github.com/hashicorp/go-cleanhttp"
	"github.com/pkg/errors"
)



@@ 27,15 28,14 @@ type Client struct {
}

func NewClient(selfURL, sjsURL, apiKey, host, role string) *Client {
	client := &http.Client{Timeout: 10 * time.Second}
	httpClient := cleanhttp.DefaultClient()
	httpClient.Timeout = 10 * time.Second
	return &Client{
		selfURL:   selfURL,
		serverURL: sjsURL,
		apiKey:    apiKey,
		client:    client,
		client:    httpClient,
		errCh:     &sjs.OptErr{},
		host:      host,
		role:      role,
	}
}