Skip to content

Commit

Permalink
Merge branch 'master' into unique-queues
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Feb 1, 2020
2 parents 343cded + 9b9dd19 commit 5ab601b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/queue/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ func (m *Manager) FlushAll(baseCtx context.Context, timeout time.Duration) error
}
allEmpty = false
if flushable, ok := mq.Managed.(Flushable); ok {
go func() {
go func(q *ManagedQueue) {
localCtx, localCancel := context.WithCancel(ctx)
pid := mq.RegisterWorkers(1, start, hasTimeout, end, localCancel, true)
pid := q.RegisterWorkers(1, start, hasTimeout, end, localCancel, true)
err := flushable.FlushWithContext(localCtx)
if err != nil && err != ctx.Err() {
cancel()
}
mq.CancelWorkers(pid)
q.CancelWorkers(pid)
localCancel()
wg.Done()
}()
}(mq)
} else {
wg.Done()
}
Expand Down

0 comments on commit 5ab601b

Please sign in to comment.