Skip to content

Commit

Permalink
nsq_to_http: use value passed by http flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyanskiy authored and mreiferson committed Feb 24, 2018
1 parent 2305c6f commit e6cf698
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
2 changes: 0 additions & 2 deletions apps/nsq_to_http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import (
"fmt"
"net/http"

"github.com/nsqio/nsq/internal/http_api"
"github.com/nsqio/nsq/internal/version"
)

var httpclient *http.Client
var userAgent string

func init() {
httpclient = &http.Client{Transport: http_api.NewDeadlineTransport(*httpConnectTimeout, *httpRequestTimeout), Timeout: *httpRequestTimeout}
userAgent = fmt.Sprintf("nsq_to_http v%s", version.Binary)
}

Expand Down
4 changes: 4 additions & 0 deletions apps/nsq_to_http/nsq_to_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io/ioutil"
"log"
"math/rand"
"net/http"
"net/url"
"os"
"os/signal"
Expand All @@ -23,6 +24,7 @@ import (
"github.com/bitly/timer_metrics"
"github.com/nsqio/go-nsq"
"github.com/nsqio/nsq/internal/app"
"github.com/nsqio/nsq/internal/http_api"
"github.com/nsqio/nsq/internal/version"
)

Expand Down Expand Up @@ -171,6 +173,8 @@ func main() {
flag.Var(&nsq.ConfigFlag{cfg}, "consumer-opt", "option to passthrough to nsq.Consumer (may be given multiple times, http://godoc.org/github.com/nsqio/go-nsq#Config)")
flag.Parse()

httpclient = &http.Client{Transport: http_api.NewDeadlineTransport(*httpConnectTimeout, *httpRequestTimeout), Timeout: *httpRequestTimeout}

if *showVersion {
fmt.Printf("nsq_to_http v%s\n", version.Binary)
return
Expand Down
50 changes: 25 additions & 25 deletions nsqadmin/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e6cf698

Please sign in to comment.