Skip to content

Commit

Permalink
fix goroutine leaks in filestore.go
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kejie Zhang <601172892@qq.com>
  • Loading branch information
kjzz committed Sep 5, 2018
1 parent 78a32f2 commit 0cfd643
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/commands/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0cfd643

Please sign in to comment.