mirror of
https://github.com/americanexpress/baton.git
synced 2025-11-24 14:35:58 +00:00
Remove unneeded variable
This commit is contained in:
parent
528f756485
commit
95b67da6a2
@ -31,7 +31,6 @@ type worker struct {
|
||||
httpResults chan<- HTTPResult
|
||||
done chan<- bool
|
||||
timings chan int
|
||||
isBuffered bool
|
||||
}
|
||||
|
||||
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 {
|
||||
requestCount := len(requests)
|
||||
isBuffered := false
|
||||
|
||||
// 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
|
||||
// buffered channel up to a fixed size and ignore the rest
|
||||
if requestCount <= 1 {
|
||||
requestCount = TimedBufferSize
|
||||
isBuffered = true
|
||||
}
|
||||
|
||||
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 {
|
||||
timeNow := time.Now().UnixNano()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user