mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-23 21:47:52 +08:00
Merge pull request #5427 from kjzz/fix-goroutine
fix goroutine leaks in filestore.go
This commit is contained in:
@ -269,10 +269,14 @@ func perKeyActionToChan(ctx context.Context, args []string, action func(*cid.Cid
|
|||||||
for _, arg := range args {
|
for _, arg := range args {
|
||||||
c, err := cid.Decode(arg)
|
c, err := cid.Decode(arg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
out <- &filestore.ListRes{
|
select {
|
||||||
|
case out <- &filestore.ListRes{
|
||||||
Status: filestore.StatusOtherError,
|
Status: filestore.StatusOtherError,
|
||||||
ErrorMsg: fmt.Sprintf("%s: %v", arg, err),
|
ErrorMsg: fmt.Sprintf("%s: %v", arg, err),
|
||||||
|
}:
|
||||||
|
case <-ctx.Done():
|
||||||
}
|
}
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
r := action(c)
|
r := action(c)
|
||||||
|
Reference in New Issue
Block a user