Skip to content

Commit 5ab601b

Browse files
authored
Merge branch 'master' into unique-queues
2 parents 343cded + 9b9dd19 commit 5ab601b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/queue/manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,17 @@ func (m *Manager) FlushAll(baseCtx context.Context, timeout time.Duration) error
183183
}
184184
allEmpty = false
185185
if flushable, ok := mq.Managed.(Flushable); ok {
186-
go func() {
186+
go func(q *ManagedQueue) {
187187
localCtx, localCancel := context.WithCancel(ctx)
188-
pid := mq.RegisterWorkers(1, start, hasTimeout, end, localCancel, true)
188+
pid := q.RegisterWorkers(1, start, hasTimeout, end, localCancel, true)
189189
err := flushable.FlushWithContext(localCtx)
190190
if err != nil && err != ctx.Err() {
191191
cancel()
192192
}
193-
mq.CancelWorkers(pid)
193+
q.CancelWorkers(pid)
194194
localCancel()
195195
wg.Done()
196-
}()
196+
}(mq)
197197
} else {
198198
wg.Done()
199199
}

0 commit comments

Comments
 (0)