Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consumer: make query nsqlookupd timeouts configurable #211

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ type wrappedResp struct {
}

// stores the result in the value pointed to by ret(must be a pointer)
func apiRequestNegotiateV1(method string, endpoint string, body io.Reader, ret interface{}) error {
httpclient := &http.Client{Transport: newDeadlineTransport(2 * time.Second)}
func apiRequestNegotiateV1(method string, endpoint string, body io.Reader, timeout time.Duration, ret interface{}) error {
httpclient := &http.Client{Transport: newDeadlineTransport(timeout)}
req, err := http.NewRequest(method, endpoint, body)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ retry:
r.log(LogLevelInfo, "querying nsqlookupd %s", endpoint)

var data lookupResp
err := apiRequestNegotiateV1("GET", endpoint, nil, &data)
err := apiRequestNegotiateV1("GET", endpoint, nil, r.config.DialTimeout, &data)
if err != nil {
r.log(LogLevelError, "error querying nsqlookupd (%s) - %s", endpoint, err)
retries++
Expand Down