mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
pin cmd: fix pinLsAll context use
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
@ -307,7 +307,7 @@ Example:
|
|||||||
if len(req.Arguments()) > 0 {
|
if len(req.Arguments()) > 0 {
|
||||||
keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n)
|
keys, err = pinLsKeys(req.Context(), req.Arguments(), typeStr, n)
|
||||||
} else {
|
} else {
|
||||||
keys, err = pinLsAll(typeStr, n)
|
keys, err = pinLsAll(req.Context(), typeStr, n)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -539,7 +539,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN
|
|||||||
return keys, nil
|
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)
|
keys := make(map[string]RefKeyObject)
|
||||||
|
|
||||||
@ -557,7 +557,7 @@ func pinLsAll(typeStr string, n *core.IpfsNode) (map[string]RefKeyObject, error)
|
|||||||
if typeStr == "indirect" || typeStr == "all" {
|
if typeStr == "indirect" || typeStr == "all" {
|
||||||
set := cid.NewSet()
|
set := cid.NewSet()
|
||||||
for _, k := range n.Pinning.RecursiveKeys() {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user