Skip to content

Commit

Permalink
actually set timeout appropriately on boosted workers
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed May 1, 2021
1 parent 45ed06c commit b1f6a0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/queue/workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (p *WorkerPool) zeroBoost() {
log.Warn("WorkerPool: %d (for %s) has zero workers - adding %d temporary workers for %s", p.qid, mq.Name, boost, p.boostTimeout)

start := time.Now()
pid := mq.RegisterWorkers(boost, start, false, start, cancel, false)
pid := mq.RegisterWorkers(boost, start, true, start.Add(p.boostTimeout), cancel, false)
go func() {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -150,7 +150,7 @@ func (p *WorkerPool) pushBoost(data Data) {
log.Warn("WorkerPool: %d (for %s) Channel blocked for %v - adding %d temporary workers for %s, block timeout now %v", p.qid, mq.Name, ourTimeout, boost, p.boostTimeout, p.blockTimeout)

start := time.Now()
pid := mq.RegisterWorkers(boost, start, false, start, cancel, false)
pid := mq.RegisterWorkers(boost, start, true, start.Add(p.boostTimeout), cancel, false)
go func() {
<-ctx.Done()
mq.RemoveWorkers(pid)
Expand Down

0 comments on commit b1f6a0c

Please sign in to comment.