Closed abierbaum closed 1 year ago
yea, it's an unusual behavior. i use this workaround when i want to wait for a queue to be empty:
if (!queue.idle()) {
await queue.drained();
}
That looks like an amazing fix. Would you like to send a PR with that change?
I was expecting that I could call
drained()
at any point and it would wait until the fastq was empty.From the implementation: https://github.com/mcollina/fastq/blob/9435e99a3be7b494c347650ab7a1ae34051a0866/queue.js#L268 it looks like this isn't true if the fastq is already empty when you call it.
I think other people may expect it to work the way I did, so I am filing a bug in case.