mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
Do not wait for results when canceled (#14607)
When canceled nobody may be listening for the results. Prevents memory buildup from cancelled requests.
This commit is contained in:
parent
d796621ccc
commit
7bc1f986e8
@ -189,7 +189,11 @@ func (o *listPathOptions) gatherResults(ctx context.Context, in <-chan metaCache
|
||||
}
|
||||
if resCh != nil {
|
||||
resErr = io.EOF
|
||||
resCh <- results
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
// Nobody wants it.
|
||||
case resCh <- results:
|
||||
}
|
||||
}
|
||||
}()
|
||||
return func() (metaCacheEntriesSorted, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user