mirror of
https://github.com/americanexpress/baton.git
synced 2025-11-24 06:26:04 +00:00
Remove unneeded variable
This commit is contained in:
parent
528f756485
commit
95b67da6a2
@ -31,7 +31,6 @@ type worker struct {
|
|||||||
httpResults chan<- HTTPResult
|
httpResults chan<- HTTPResult
|
||||||
done chan<- bool
|
done chan<- bool
|
||||||
timings chan int
|
timings chan int
|
||||||
isBuffered bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type workable interface {
|
type workable interface {
|
||||||
@ -46,18 +45,16 @@ func (worker *worker) setCustomClient(client *fasthttp.Client) {
|
|||||||
|
|
||||||
func newWorker(requests <-chan bool, httpResults chan<- HTTPResult, done chan<- bool) *worker {
|
func newWorker(requests <-chan bool, httpResults chan<- HTTPResult, done chan<- bool) *worker {
|
||||||
requestCount := len(requests)
|
requestCount := len(requests)
|
||||||
isBuffered := false
|
|
||||||
|
|
||||||
// If this is running in timed mode we cannot predict the number of requests being
|
// If this is running in timed mode we cannot predict the number of requests being
|
||||||
// sent, to allocate a large enough channel. As a compromise we fill in the
|
// sent, to allocate a large enough channel. As a compromise we fill in the
|
||||||
// buffered channel up to a fixed size and ignore the rest
|
// buffered channel up to a fixed size and ignore the rest
|
||||||
if requestCount <= 1 {
|
if requestCount <= 1 {
|
||||||
requestCount = TimedBufferSize
|
requestCount = TimedBufferSize
|
||||||
isBuffered = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
timings := make(chan int, requestCount)
|
timings := make(chan int, requestCount)
|
||||||
return &worker{*newHTTPResult(), &fasthttp.Client{}, requests, httpResults, done, timings, isBuffered}
|
return &worker{*newHTTPResult(), &fasthttp.Client{}, requests, httpResults, done, timings}
|
||||||
}
|
}
|
||||||
func (worker *worker) performRequest(req *fasthttp.Request, resp *fasthttp.Response) bool {
|
func (worker *worker) performRequest(req *fasthttp.Request, resp *fasthttp.Response) bool {
|
||||||
timeNow := time.Now().UnixNano()
|
timeNow := time.Now().UnixNano()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user