mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 05:47:51 +08:00
fix goroutine leaks in filestore.go
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
This commit is contained in:
parent
78a32f2e48
commit
7a9c7b4dd3
@ -269,10 +269,14 @@ func perKeyActionToChan(ctx context.Context, args []string, action func(*cid.Cid
|
||||
for _, arg := range args {
|
||||
c, err := cid.Decode(arg)
|
||||
if err != nil {
|
||||
out <- &filestore.ListRes{
|
||||
select {
|
||||
case out <- &filestore.ListRes{
|
||||
Status: filestore.StatusOtherError,
|
||||
ErrorMsg: fmt.Sprintf("%s: %v", arg, err),
|
||||
}:
|
||||
case <-ctx.Done():
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
r := action(c)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user