Skip to content

Commit

Permalink
pin cmd: fix pinLsAll context use
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <[email protected]>
  • Loading branch information
magik6k committed Mar 19, 2018
1 parent 8dd552c commit 79d35ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Example:
if len(req.Arguments()) > 0 {
keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n)
} else {
keys, err = pinLsAll(typeStr, n)
keys, err = pinLsAll(req.Context(), typeStr, n)
}

if err != nil {
Expand Down Expand Up @@ -539,7 +539,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN
return keys, nil
}

func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) {
func pinLsAll(ctx context.Context, typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error) {

keys := make(map[string]RefKeyObject)

Expand All @@ -557,7 +557,7 @@ func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error)
if typeStr == "indirect" || typeStr == "all" {
set := cid.NewSet()
for _, k := range n.Pinning.RecursiveKeys() {
err := dag.EnumerateChildren(n.Context(), dag.GetLinksWithDAG(n.DAG), k, set.Visit)
err := dag.EnumerateChildren(ctx, dag.GetLinksWithDAG(n.DAG), k, set.Visit)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 79d35ba

Please sign in to comment.