mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00: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:
1 parent
d796621ccc
commit
7bc1f986e8
1 file changed
+5
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user