Unverified 提交 8417818a 作者: Steven Allen 提交者: GitHub

Merge pull request #6505 from ipfs/fix/slightly-faster-gc

fix: slightly faster gc
......@@ -503,7 +503,7 @@ func pinLsAll(req *cmds.Request, typeStr string, n *core.IpfsNode, emit func(val
if typeStr == "indirect" || typeStr == "all" {
for _, k := range n.Pinning.RecursiveKeys() {
var visitErr error
err := dag.WalkDepth(req.Context, dag.GetLinksWithDAG(n.DAG), k, 0, func(c cid.Cid, depth int) bool {
err := dag.WalkParallelDepth(req.Context, dag.GetLinksWithDAG(n.DAG), k, 0, func(c cid.Cid, depth int) bool {
if depth == 0 {
// skip it without visiting it.
return true
......
......@@ -209,7 +209,7 @@ func (api *PinAPI) pinLsAll(typeStr string, ctx context.Context) ([]coreiface.Pi
if typeStr == "indirect" || typeStr == "all" {
set := cid.NewSet()
for _, k := range api.pinning.RecursiveKeys() {
err := merkledag.WalkDepth(
err := merkledag.WalkParallelDepth(
ctx, merkledag.GetLinksWithDAG(api.dag), k, 0,
func(c cid.Cid, depth int) bool {
// don't visit the root node, that doesn't count.
......
......@@ -171,7 +171,7 @@ func Descendants(ctx context.Context, getLinks dag.GetLinks, set *cid.Set, roots
for _, c := range roots {
// Walk recursively walks the dag and adds the keys to the given set
err := dag.Walk(ctx, verifyGetLinks, c, set.Visit)
err := dag.WalkParallel(ctx, verifyGetLinks, c, set.Visit)
if err != nil {
err = verboseCidError(err)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论