Skip to content

Commit

Permalink
Merge pull request #67 from roybabayov/royb/timer_usage
Browse files Browse the repository at this point in the history
fix send timeout timer.reset usage
  • Loading branch information
meirleopold authored Mar 17, 2021
2 parents de4731c + b358655 commit 5ff4fe2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions httpblaster/worker/worker_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ func (w *WorkerBase) send(req *fasthttp.Request, resp *fasthttp.Response,
w.ch_duration <- end.Sub(start)
}()

if !w.timer.Stop() {
<-w.timer.C
}
w.timer.Reset(timeout)
select {
case duration := <-w.ch_duration:
Expand Down

0 comments on commit 5ff4fe2

Please sign in to comment.