This commit is contained in:
alex.sharov 2023-04-19 12:26:32 +07:00
parent 93d594cc8a
commit ff3e6e629b

View File

@ -316,14 +316,14 @@ func (q *ResultsQueueIter) PopNext() *TxTask {
}
func (q *ResultsQueue) Drain(ctx context.Context) error {
q.Lock()
l := q.results.Len()
q.Unlock()
//q.Lock()
//l := q.results.Len()
//q.Unlock()
//if queue is empty, then need block to wait new results
if l > 0 {
q.drainNoBlock(nil)
return nil
}
//if l > 0 {
// q.drainNoBlock(nil)
// return nil
//}
select {
case <-ctx.Done():