mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-22 12:51:19 +08:00
fix(commands): fix filestore.go goroutine leak
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
This commit is contained in:
@ -218,11 +218,18 @@ var dupsFileStore = &oldCmds.Command{
|
|||||||
for cid := range ch {
|
for cid := range ch {
|
||||||
have, err := fs.MainBlockstore().Has(cid)
|
have, err := fs.MainBlockstore().Has(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
out <- &RefWrapper{Err: err.Error()}
|
select {
|
||||||
|
case out <- &RefWrapper{Err: err.Error()}:
|
||||||
|
case <-req.Context().Done():
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if have {
|
if have {
|
||||||
out <- &RefWrapper{Ref: cid.String()}
|
select {
|
||||||
|
case out <- &RefWrapper{Ref: cid.String()}:
|
||||||
|
case <-req.Context().Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Reference in New Issue
Block a user